Go Down

Topic: Problem Firmata on raspberry pi (python) (Read 675 times) previous topic - next topic

Python Err Code:
Code: [Select]

Traceback (most recent call last):
  File "/home/pi/Desktop/pyfirmata.py", line 3, in <module>
    import pyfirmata
  File "/home/pi/Desktop/pyfirmata.py", line 7, in <module>
    board = pyfirmata.Arduino(PORT)
AttributeError: 'module' object has no attribute 'Arduino'


Python Code:
Code: [Select]

#!/usr/bin/python

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


Sorry, im speak spanish.

Disculpen el idioma, el problema que tengo es que me tira un error, y no se en que me estoy equivocando, ese es solo un blink pero usando firmata, en el arduino le cargue el StandarFirmata que viene de ejemplo en el ide.

spatula

It seems that your source is called pyfirmata.py, so when you import pyfirmata you are actually importing your own file, not the library. Try using a different name for your file.

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy