Hello all, I'm playing around with the latest arduino object for pd, and it seems that there is a disconnect between the numbering for port I/O data-direction, and setting the value of a pin. I'm using the arduino-test.pd patch, as well as the [pd DIGITAL-OUTPUT] behavior pulled from the arduino help patch.
For instance, I set up a LED on the digital pin numbered 6 that I could turn on and off, just to test it out, and found the following mappings. data direction: checkbox 6 assert a value: checkbox 13
Why does 6 (data direction) correspond to 13 (assert a voltage)? (please see attached image for more clarity about what I mean) thanks, -David Merrill p.s. also, clicking the "pulse all outputs" box in arduino-test.pd crashes PD after a few seconds - I suspect due to a comport problem.. can anyone else replicate this?
Hallo!
I'm playing around with the latest arduino object for pd, and it seems that there is a disconnect between the numbering for port I/O data-direction, and setting the value of a pin. I'm using the arduino-test.pd patch, as well as the [pd DIGITAL-OUTPUT] behavior pulled from the arduino help patch.
I don't really understand this - you mean you can set input/output mode for pin 13 with toggle 6 (and please try it in the help-patch) ?
p.s. also, clicking the "pulse all outputs" box in arduino-test.pd crashes PD after a few seconds - I suspect due to a comport problem..
Do you have the latest firmware and have you tried the PWN-OUT of the help patch?
LG Georg
Georg Holzmann wrote:
Hallo!
I'm playing around with the latest arduino object for pd, and it seems that there is a disconnect between the numbering for port I/O data-direction, and setting the value of a pin. I'm using the arduino-test.pd patch, as well as the [pd DIGITAL-OUTPUT] behavior pulled from the arduino help patch.
I don't really understand this - you mean you can set input/output mode for pin 13 with toggle 6 (and please try it in the help-patch) ?
Hi Georg,
What I'm confused about is that usually in microcontroller programming, there is a symmetry between setting the data direction of a pin (i.e. input or output), and setting/clearing a bit on that pin. For instance, in AVR C, if I want to assert a HIGH voltage on pin D0, I would write:
DDRD = 0x01; // set data direction for pin 0, port D to output PORTD |= 0x01; // set value of pin 0, port D to HIGH
..so the same value is used both to set the data direction and set the bit on the pin. That's what I'm confused about the example patch for arduino - where the same number does not get passed for data direction as for pin setting (see my previous attached .jpg). It's probably because I didn't dig into the example to see why this mapping is different - but since arduino/pduino is supposed to be good for physical computing students who know little about the nitty-gritty details of hardware/software integration, it should be as straightforward as possible.
The patch in the .jpg that I sent is the arduino-test.pd, with the "I/O the individual pins" section taken from arduino-help.pd. I'm pretty sure I have the latest pduino firmware - I downloaded from HCS's website directly yesterday. thanks, -David
p.s. also, clicking the "pulse all outputs" box in arduino-test.pd crashes PD after a few seconds - I suspect due to a comport problem..
Do you have the latest firmware and have you tried the PWN-OUT of the help patch?
LG Georg
Hallo David !
What I'm confused about is that usually in microcontroller programming, there is a symmetry between setting the data direction of a pin (i.e. input or output), and setting/clearing a bit on that pin. For instance, in AVR C, if I want to assert a HIGH voltage on pin D0, I would write:
DDRD = 0x01; // set data direction for pin 0, port D to output PORTD |= 0x01; // set value of pin 0, port D to HIGH
okay... (I think I still didn't really get what you want to say ...) For the arduino there is a function to define input/output of a pin and then to write/read from that pin ... So in PD this are "wrappers" for these funcions - you have to set input/output mode firt one time, then you can simply use digital in- or output ...
different - but since arduino/pduino is supposed to be good for physical computing students who know little about the nitty-gritty details of hardware/software integration, it should be as straightforward as possible.
it should be as straightforward as possible (I mean the help patch - the test patch is a little bit confusing ...)
LG Georg
On Sep 21, 2006, at 10:21 AM, David Merrill wrote:
Georg Holzmann wrote:
Hallo!
I'm playing around with the latest arduino object for pd, and it
seems that there is a disconnect between the numbering for port I/ O data-direction, and setting the value of a pin. I'm using the
arduino-test.pd patch, as well as the [pd DIGITAL-OUTPUT]
behavior pulled from the arduino help patch.I don't really understand this - you mean you can set input/output
mode for pin 13 with toggle 6 (and please try it in the help-patch) ?Hi Georg,
What I'm confused about is that usually in microcontroller
programming, there is a symmetry between setting the data direction
of a pin (i.e. input or output), and setting/clearing a bit on that
pin. For instance, in AVR C, if I want to assert a HIGH voltage on
pin D0, I would write:DDRD = 0x01; // set data direction for pin 0, port D to output PORTD |= 0x01; // set value of pin 0, port D to HIGH
..so the same value is used both to set the data direction and set
the bit on the pin. That's what I'm confused about the example
patch for arduino - where the same number does not get passed for
data direction as for pin setting (see my previous attached .jpg).
It's probably because I didn't dig into the example to see why this
mapping is different - but since arduino/pduino is supposed to be
good for physical computing students who know little about the
nitty-gritty details of hardware/software integration, it should be
as straightforward as possible.The patch in the .jpg that I sent is the arduino-test.pd, with the
"I/O the individual pins" section taken from arduino-help.pd. I'm
pretty sure I have the latest pduino firmware - I downloaded from
HCS's website directly yesterday. thanks, -Davidp.s. also, clicking the "pulse all outputs" box in arduino- test.pd crashes PD after a few seconds - I suspect due to a
comport problem..Do you have the latest firmware and have you tried the PWN-OUT of
the help patch?
This stuff is definitely under development ;). I changed [bytemask]
and [debytemask] to have the Most Significant Bit on the left most
outlet rather than before, the Least Significant Bit. I think that
might be the cause of your problem.
You can download a newer test version of Pd-extended or download the
files in question from cvs. They are in externals/mapping
.hc
There is no way to peace, peace is the way. -A.J. Muste