« Sonntag und schlechtes Wetter = selbergemachte LinzertorteNautilus und Betriebssystem »

Firmata firmware and the Arduino

If your Arduino is running with the latest Firmata firmware (aka sketch), you will notice that there are plenty of issues with binding implementations. This is because the Firmata protocol implements some new features of the past years and some bindings are not updated to work with Firmata > 2.0.

I started with python-firmata. Not really useful, it's outdated. Then I found pyfirmata which is working with newer versions of Firmata.

import pyfirmata
 
PIN = 12
DELAY = 2
PORT = '/dev/ttyACM0'
 
board = pyfirmata.Arduino(PORT)
 
while True:
    board.digital[PIN].write(1)
    board.pass_time(DELAY)
    board.digital[PIN].write(0)
    board.pass_time(DELAY)

Download it from here.

  02/19/12 01:15:00 pm, by fab   , 87 words, Categories: General, Arduino ,

2 comments

Comment from: Doig [Visitor]
Doig

what sketch should I upload to the Arduino for this code to work? And do I just wire an LED on digital 12?

Thanks!

08/06/12 @ 16:07
Comment from: fab [Member]  
fab

Standard Firmata is the needed sketch. A LED with a resistor, one leg to GRD, one leg to D12.

08/07/12 @ 18:07