Pages: [1]   Go Down
Author Topic: Problem Firmata on raspberry pi (python)  (Read 454 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 27
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Python Err Code:
Code:
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:
#!/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.
Logged

Rome, Italy
Offline Offline
Sr. Member
****
Karma: 20
Posts: 442
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Pages: [1]   Go Up
Jump to: