0 Content
- Setting up Raspberry Pi
- Setting up Arduino
- Run simple test program
- Links
1 Setting up Raspberry Pi
Log in to your RPi with ssh and go to downloads
$ cd Downloads/
Next download and extract pySerial library
$ wget https://pypi.python.org/packages/source/p/pyserial/pyserial-2.6.tar.gz#md5=cde799970b7c1ce1f7d6e9ceebe64c98
$ tar -zxvf pyserial-2.6.tar.gz
Install pySerial and go back to Downloads
$ cd pyserial-2.6/
$ sudo python setup.py install
$ cd ..
Install a git client, because we will be cloning pyFirmata library from github.
$ sudo apt-get update
$ sudo apt-get install git-core
$ git clone https://github.com/tino/pyFirmata.git
$ cd pyFirmata
$ sudo python setup.py install
2 Setting up Arduino
Connect your arduino and open Arduino IDE. Open StandardFirmata sketch from examples: File>examples>Firmata>StandardFirmata. Upload the code to your arduino, then connect it to Raspberry Pi with usb. Make sure raspberry pi sees arduino:
$ lsusb
You sould see something like this "Bus 001 Device 007: ID 2341:0001 Arduino SA Uno (CDC ACM)".
3 Running simple test program
Download blink example to your Raspberry Pi from https://bitbucket.org/fab/pyfirmata/src/96116e877527/examples
Connect a led to arduino pin 12 and run blink.py from raspberry.
$ python blink.py
ImportError: no module named "pyfirmata"
ReplyDelete