Pduino Reference

Messages the [arduino] object will accept

 

PD OBJECT

[arduino]                                Pd object with optional device number of Arduino board.

 

SETUP

[open  serial-port# (                open serial port #

[close(                                      close the open serial port

[pinMode  pin#  mode(           set digital pin mode for: input (0), output (1), analog (2), pwm (3) mode and servo (4). Digital pins default to input mode.

 

INFORMATION

[info(   or  [version(               receive a message ’version number1 number2 ’, where number1 and number2 are the Firmata version numbers.

[devices(                                  list available serial ports in console

 

OUTPUT from pins (e.g. LED)

[digital  pin#  value(                set digital pin high (1) or low (0)

[pwm  pin# value(                   set digital PWM pin to a value from 0 to 1. This pseudo analog out must use one of the PWM pins (3, 5, 6, 9, 10 or 11)

[port  port# value(                  set 8 pins at the same time with one message*

 

INPUT to pins (e.g. switch or pot)

[digitalIns  port# value(          enabled/disable input reporting of digital pins by port (digital data from Arduino board)*

[analogIns  pin#  value(          enable/disable (value=1/0) analog pins (pin#) (analog inputs enabled per-pin)

* Ports are groups of digital pins: port 0 = pins 0-7; port 1 = pins 8-13

**When the Arduino board sends data (via USB) about its digital or analog inputs it is received by the arduino object in PD and made available from the left outlet. Use the [print] object to see what the Arduino board is sending or the [route] object to extract the values. Messages from the arduino object are in the form:

digital pin# value

analog pin# value

 

 

Note: words within a square bracket and a parenthesis denote a Pd message.