Search wiring.org.co:

Libraries

## Wiring/Openframeworks using Firmata Protocol

This library allows to control the Wiring I/O board from Openframeworks without write code in the Wiring IDE. Instead, you must upload the StandardFirmata sketch placed in File->Examples->Firmata->Example.

The library Wiring/Openframeworks and some examples can be downloaded from here

The tutorial to use the library with Openframeworks is here

ofWiring
Creates the Wiring object.

connect()
Starts the communication with the I/O board.

disconnect()
Ends the communication with the I/O board.

isWiringReady()
Returns true if the I/O board is ready to transfer data.

update()
Polls data from the serial port.

setUseDelay()
Enable a delay time.

isInitialized()
Returns true if a succesfull connection has been established.

sendDigitalPinMode()
Sets a digital pin as INPUT or OUTPUT mode.

sendAnalogPinReporting()
Enable the report from a given pin.

sendDigital()
Writes HIGH or LOW in a digital pin.

sendPwm()
Writes a PWM value.

sendString()
Sends a string no longer than 12 characters.

sendReset()
Sends a byte to reset the firmata protocol.

sendByte()
Send a byte.

getPwm()
Returns the last set PWM value (0-255) for the given pin.

getDigital()
Returns the last received value or the last set value for the given pin.

getAnalog()
Returns the last received analog value (0-1023) for the given pin.

getString()
Returns the last received string.

getDigitalPinMode()
Returns INPUT, OUTPUT, PWM, SERVO, ANALOG.

getAnalogPinReporting()
Returns ON, OFF.