Moi, does anybody know, if it is possible to control the Ping(ultrasonic range finder)sensor using only Pduino (first uploading Pd-firmware to the arduino, and then using the "arduino" pure data patch?). It doesn't work for me at the moment.
If I write my own ping-sensor-patch for arduino and then use the PD_inputs_to_PD patch it works fine.
But I'd like to use several different sensors and it would therefore be much easier to just control all of them with Pduino and not writing new code for arduino all the time. Well, guess this was the original idea of Pduino anyways :-)
MArko
Marko Timlin wrote:
Moi, does anybody know, if it is possible to control the Ping(ultrasonic range finder)sensor using only Pduino (first uploading Pd-firmware to the arduino, and then using the "arduino" pure data patch?). It doesn't work for me at the moment.
The Ping needs you to send a trigger and wait for an echo, and the delay needs to be precisely timed. Unfortunately pd can't communicate with the arduino or anything else outside the machine it's running on with enough timing precision to do that. (Sound travels about 1 foot per millisecond and the timing jitter with comport can be up to about 10ms, so your measurements will almost always be off by several feet.)
If I write my own ping-sensor-patch for arduino and then use the PD_inputs_to_PD patch it works fine.
Because the serial communication timing is not involved.
But I'd like to use several different sensors and it would therefore be much easier to just control all of them with Pduino and not writing new code for arduino all the time. Well, guess this was the original idea of Pduino anyways :-)
The code for many sensors is almost the same as the code for one sensor, so it shouldn't be too hard. If you must use Pduino, you could try one of the EZ1 sensors, it has an analog output that you can connect to an arduino analog in: http://www.hvwtech.com/products_view.asp?ProductID=560 I've used it with Pduino with no problems. I guess the other approach is to add modules to pduino that specifically handle specific hardware, but there is a _lot_ of hardware out there...the main ones that need doing are stepper motors (two or four pins have to change at the same time at precise times), servo motors (pulse width needs to be between 1 and 2 ms), and sonar sensors, as well as any hardware with a serial interface like servo controllers (serial data bits need to be accurately timed to about 2% of the data rate). Most everything else isn't as sensitive to timing.
Martin
hmm, I think arduino can handle the ping range finder. but you need to write your specific code. use a code that you find online (the routine is something like: turn pin to outlet, set pin high, wait some milliseconds, set pin low, turn pin to inlet, measure the time until you receive the echo...) and then send the value to pd via serial port (115200). then measure next value. I think, you should be able to send at least 20 values per second, but that is a guess. do you need more info for the arduino code? how many sensors do you have? marius.
it is
Marko Timlin wrote:
Moi, does anybody know, if it is possible to control the Ping(ultrasonic range finder)sensor using only Pduino (first uploading Pd-firmware to the arduino, and then using the "arduino" pure data patch?). It doesn't work for me at the moment.
If I write my own ping-sensor-patch for arduino and then use the PD_inputs_to_PD patch it works fine.
But I'd like to use several different sensors and it would therefore be much easier to just control all of them with Pduino and not writing new code for arduino all the time. Well, guess this was the original idea of Pduino anyways :-)
MArko
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Marko Timlin ha scritto:
Moi, does anybody know, if it is possible to control the Ping(ultrasonic range finder)sensor using only Pduino (first uploading Pd-firmware to the arduino, and then using the "arduino" pure data patch?). It doesn't work for me at the moment.
If I write my own ping-sensor-patch for arduino and then use the PD_inputs_to_PD patch it works fine.
But I'd like to use several different sensors and it would therefore be much easier to just control all of them with Pduino and not writing new code for arduino all the time. Well, guess this was the original idea of Pduino anyways :-)
I had the same problem. you can find the code I wrote fr making the ultrasonic ranger work, here: http://puredata.info/Members/federico/arduino
despite its simplicity, I had troubles integrating it into Pduino firmware
anyway that's the proof-of-concept that it works
hth
On Dec 30, 2007, at 6:43 AM, mescalinum@gmail.com wrote:
Marko Timlin ha scritto:
Moi, does anybody know, if it is possible to control the Ping (ultrasonic range finder)sensor using only Pduino (first uploading
Pd-firmware to the arduino, and then using the "arduino" pure data
patch?). It doesn't work for me at the moment.If I write my own ping-sensor-patch for arduino and then use the
PD_inputs_to_PD patch it works fine.But I'd like to use several different sensors and it would
therefore be much easier to just control all of them with Pduino
and not writing new code for arduino all the time. Well, guess
this was the original idea of Pduino anyways :-)I had the same problem. you can find the code I wrote fr making the ultrasonic ranger work, here: http://puredata.info/Members/federico/arduino
despite its simplicity, I had troubles integrating it into Pduino
firmwareanyway that's the proof-of-concept that it works
To make it work with Firmata,
the Firmata class) 2) use this to send analog data to the computer:
Firmata.sendAnalog(analogPin, pulseTime);
Then this will work with any arduino class, like Pd, python, Max, etc.
Computer science is no more related to the computer than astronomy is
related to the telescope. -Edsger Dykstra
Hi, I am a big fan of integrated circuits such as a multiplexer (the 296-2057-5-ND on digikey) to have more analog inputs (in this case). Also, I write my own Arduino code, and use http://www.arduino.cc/playground/Code/SimpleMessageSystem as a mean of communication with pd. (in case it is useful)
a
2007/12/31, Hans-Christoph Steiner hans@eds.org:
On Dec 30, 2007, at 6:43 AM, mescalinum@gmail.com wrote:
Marko Timlin ha scritto:
Moi, does anybody know, if it is possible to control the Ping (ultrasonic range finder)sensor using only Pduino (first uploading Pd-firmware to the arduino, and then using the "arduino" pure data patch?). It doesn't work for me at the moment.
If I write my own ping-sensor-patch for arduino and then use the PD_inputs_to_PD patch it works fine.
But I'd like to use several different sensors and it would therefore be much easier to just control all of them with Pduino and not writing new code for arduino all the time. Well, guess this was the original idea of Pduino anyways :-)
I had the same problem. you can find the code I wrote fr making the ultrasonic ranger work, here: http://puredata.info/Members/federico/arduino
despite its simplicity, I had troubles integrating it into Pduino firmware
anyway that's the proof-of-concept that it works
To make it work with Firmata,
- first remove any Serial class references (Serial.begin() is run by
the Firmata class) 2) use this to send analog data to the computer:
Firmata.sendAnalog(analogPin, pulseTime);
Then this will work with any arduino class, like Pd, python, Max, etc.
.hc
Computer science is no more related to the computer than astronomy is related to the telescope. -Edsger Dykstra
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list