examples/communication/firmataExample/README.md
This Example demonstrates communication with Arduino using the Firmata protocol.
Running this example requires uploading Firmata to your Arduino. With your Arduino connected, open Arduino and navigate to File -> Examples -> Firmata and open StandardFirmata. Compile and upload StandardFirmata for your board before running this application.
This example covers the following functions:
In the code, pay attention to:
ard.connect("/dev/tty.usbmodemfd121", 57600)ofAddListener() and ofRemoveListener() on the setupArduino() function to listen for connectionsendPwm() for pulse width modulation and fadingsendServo() for controlling servo motorssendDigital() for sending digital pulses (HIGH / LOW)sendAnalog() for sending analog data (in a 0-255 range)When launching this app, you should see a screen with an image of an Arduino and a breadboard.
While the Arduino is not connected,
This Example uses no other classes.