Go Down

Topic: pduino [arduino] object in puredata (Read 4182 times) previous topic - next topic


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 :)

here it is:

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"




Cool.  I added a link in the Arduino playground PD section: http://www.arduino.cc/playground/Interfacing/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    ?-? ?-? ?-? ?-? ?-?
- 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

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  8-)

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




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


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


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:

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?




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


Go Up