Arduino Firmata Serial - Simple Example

**Please Help A Beginner **

I am a beginner working with Arduino and would like to send an int from my OF program via a serial port to Arduino.

I have noticed when I compile the OF framework that I see files with the names Arduino and Firmata and so I assume it is easy.

All I need is a very simple step by step as to what code to use in OF.

Maybe something simple like making an LED blink on digital port 13 of the Arduino using vars sent from the OF program.

I am not even necessarily hooked on Firmata I just want a good serial solution.

I am sure this is an easy question for your more experienced programmers out there. any help would be lovely.

thank you :wink:

hi, if you take a look to the firmataExample, it do just that, make a led blink + also read the values from a potentiometer. if you are used to programming the arduino, you’ll see this is really similar. You will need to upload the StandardFirmata sketch to the arduino first. from the arduino ide go to file > sketchbook > examples > Library -firmata > StandardFirmata. and upload it to the arduino. with this you can control any oin directly from oF

thank you - will do.

one thing to watch out for is in the latest arduino (version 17), the standard firmata default speed is changed. in the standard firmata sketch in arduino (file->examples->firmata->standard firmata) you’ll notice:


this has changed in the latest version, and you’ll either need to change the OF code to match that new baud rate (it’s clear that we set it up as 115200 if you open up our firmata example and look at the setup in testApp.cpp), or change the baud rate in the firmata code on the arudino side to match us (115200). probably it’s cleaner to alter OF to match. Obviously, you’ll get funky behavior if they don’t match.

in earlier versions of arduino, the baud rates matched – in our next release will match it up and include some info about the change. Just an example of release schedules differing :wink:

take care!