Arduino MEGA 2560 - Firmata

Hello at all,
I’m working to enable to use the arduino mega board trough firmata.
I don’t find the code to change for use it.
I need to use 17 button and 17 led.
anything have an idea or help me?


Hello aelfwine,

here are some links that can be useful for you:

Also check the innards of of the Arduino (Devices StandardFirmata 2.x).

Hope this helps,

i remember on node, Jens Alexander or Sebastian, i dont remember who, show me a bug on the firmata plugin, where the encodding was “wrong” inside the rs232 node, that why it fails after several buttons, can remember how to fix it, anyone ?

back to the topic,

aelfwine you want to use it over usb with firmata ? another way is via OSC and a ethernet shield, it requires a little bit of more work, but i can help you with that, i done it before, let me know!

thanks for your quickly response…
I usually use firmata protocol with Arduino UNO board but now I need to use with an Arduino Mega 2560.
Whit the arduino patch this is possible?

can you help me?

yes it is possible and has be done by some users here. i still wonder why none of them is sharing their arduino mega module

basically, you can setup the firmata plugins to any number of inputs and outputs via the inspector. just make sure all numbers are matching including the “Pin Modes” spread.

wow…I will try…
thanks so much

I’ve tried but It doesn’t work fine.
I’m able to control the digital output pin but I can’t read the digital Input.
I put on the 3 red mark object 6 analog and 54 digital.
I follow the instruction on firmata website and I change the samplerate on the arduino patch

…is it correct?


p.s. in order to test the input i simple try connecting the pin to ground.

i had a go with it ages ago, but my hack didn’t prove to be stable.

i always seem to write my own arduino code eventually because the ethernet ones are so much more to my liking, so I never looked at firmata again

i can’t reproduce this since i don’t own a mega. make sure encoder and decoder have the same settings. i don’t know about any samplerate change.

it might be nessecary to setup the nodes, save and restart vvvv.

I had the same troubles in trying to configure the Arduino Node for the Mega.
Got it working (same way as u7 showed) but by far not stable and often had problems to connect to the Mega when Arduino Patch was modified(setting Encoder and Decoder to different IO count).

Otherwise i would have shared it…

So mostly i switched to OSC(etherenet shield), when it came to the Mega.

I’m trying to check all the I/O of the Arduino Mega…at the moment it works…

anything have a tutorial to use OSC ethernet shield with VVVV??



arduinoosc i used that Contribution.

Worked out of the box in my case.

I also have trouble with mega 2560 and firmata. Using the servo and analog pin modes, it works but the digital pins are dead.

For example I tried to follow this great tutorial: firmata-arduino-and-vvvv-an-introduction. Following the indications the servo and the potmeter examples works fine, but the button example with digital input is not working.

I changed the FirmataEncode and Firmatadecode pin numbers in Inspektor to 16 analog and 54 digital input count, Pin Modes and Input box to 70. I saved and restarted the patch. When I push the button on breadboard the pin nr. 2 (or any other) digital input value is not changing like in the video… I don`t know what is the problem.

Yes, I lied in that Tutorial, never tested it, just assumed it worked. Sorry.

I dont have a Mega to test or help you. Me bad, me sorry.

Did you do what U7Angel said, open the module, and change the settings there?

Hi Westbam!
Yes I do that. I don`t tried yet to change the sampling interval in file StandardFirmata.ino from 19ms into 99ms as aelfwine suggested earlier. Later I will make a test and I will post if it helps.

Changing the sampling interval as described didn`t help me.

I restarted the tests with the digital pins using the help pathes from the addonpack. A made the electrical connections for the Bargraph (Simple) patch and it works for the fist try all six digital outputs used here! Another example from Prototyping interfaces also works with a button as digital input.

Probably I did a mistake in electrical wiring when I tried earlier … I made a modified version of Arduino modul for Mega 2560, which apparently works, I didn`t tested fully, but if someone is interested, is here.

Arduino (Devices StandardFirmata 2.x)Mega2560.v4p (32.9 kB)