[PD] Pduino&Ping ultrasonic sensor&arduino

Hans-Christoph Steiner hans at eds.org
Mon Dec 31 21:08:39 CET 2007

On Dec 30, 2007, at 6:43 AM, mescalinum at 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,

1) 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.


Computer science is no more related to the computer than astronomy is  
related to the telescope.      -Edsger Dykstra

More information about the Pd-list mailing list