pduino [arduino] object in puredata

yesterday hans c steiner made public in the pd list the fimware for the arduino that will allow us users to change stuff directly from pd :slight_smile:

here it is:
http://at.or.at/hans/pd/objects.html

im openning this thread to see if anyone shares here knowledge and uses since im just beginning to play and learn what can be done with the "bicho"

tchuss!

/a

Cool. I added a link in the Arduino playground PD section: Arduino Playground - PD

Now, we just need to implement Java/Processing/Flash classes for interfacing with the same firmware.

Now, we just need to implement Java/Processing/Flash classes for interfacing with the same firmware.

Yes, yes! I'll gladly help out anyone who is interested in making objects for other environments. Plus, I am sure that the firmware could be improved, if anyone wants to take that on. For example, implementing the pulseIn control.

I'll copy here for everybody the discussion we had via e-mail
in Flash it can be a lot more complicated, but not impossible.

I didn't understand how pd handles the incoming data
how do you register an object in pd to a specific imput from Arduino?
how do you do something like this
val1 = analogRead(pin5)
val2 = digitalRead(pin6)

you wrote in the e-mail

To start read data from Arduino, you wait for the cycle marker byte: 255. Then you are at the top of the cycle. The next byte is digital pins 0-6, then digital pins 7-14. Then comes byte pairs for each analogIn, which are reassembled to make the 10-bit value. To send digital data to Arduino, its just a 3 byte cycle, 255 for the marker, one by for digital pins 0-6 and the next byte for pins 7-13.

I can understand if you serialize the data coming from Arduino
so that Arduino sends a long "string" or byte-cycle like
255 0 0 0 0 0 0 0 0 0 0 0 0 ?-? ?-? ?-? ?-? ?-?
where

  • 255 is the starting cycle marker
  • 6 bytes for digital pin 1->6
  • 6 bytes for digital pin 7->14
  • 5 pairs(?-?) what do they look like (I have to test it yet)

in this case is a bit easyer
there is only one object that listens to the incoming data and then dispatches the different information
to whoever is listening...or they simply pull the data from the dataset...
it could create some asyncronous computation but I'm not sure
I fear that it can be a mess to code for the user...but i'll give it a try

in the end of the day it would be great to code in Actionscript something like
// read analog value
val = Arduino.pin0.value
//set digital value
Arduino.pin6.value = HI;
//set action
Arduino.pin9.pulseTo(someValue)

in fact the pulsing could be handled internally by Flash with no problems and just sending single digitalWrites at the specified rate..that could be really cool...and doing FFT inside flash :o :sunglasses:

What I fear is that the architecture would ask the user to code more or less the same things inside Flash that he would do in Arduino...I can see almost no point in that

it could be great if you could explain on the wiki a bit better the "string" that has to be SENT TO Arduino to set commands and the "string" that is RECEIVED FROM Arduino..
give some examples, it would make it easier.

I'll try it out

b.

hia!

is someone out there not using corporative software?? lets get back this thread to its path :stuck_out_tongue:

I continued the discussion of the sensorbox firmware + flash in a new thread:

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1148554125

But please do post questions with the Pduino code here and I'll check it.

hi hans, first of.. i might be wrong but i guess the Pduino.01 release should include these filez you mentioned on the pd-list:
http://lists.puredata.info/pipermail/pd-list/2006-06/039287.html

they fixed some errors i was having..

and, apart from that, could you give a hand on getting to control a stepper motor via firmata?

tx!

/a

On a related note, Martin Peach has written a PIC firmware that is compatible with the Pduino/Firmata firmware and the [arduino] Pd object: