py-arduino access Arduino from Python

Documents

How to install py-arduino
Common problems
py_arduino.cli.*: How to use
py_arduino.cli.*: Reference

Examples - Low level

Temperature sensing (LM35)

Examples - Web Application

TODO

---

View the Project on GitHub hgdeoro/py-arduino

Install from GitHub in 4 steps

Step 1: clone the repository & cd to it

~/$ git clone https://github.com/hgdeoro/py-arduino.git
~/$ cd py-arduino
~/py-arduino$

Clone the repo

Step 2: create a virtualenv & install required libraries

~/py-arduino$ virtualenv -p python2.7 virtualenv
~/py-arduino$ . virtualenv/bin/activate
(virtualenv)~/py-arduino$ pip install -r requirements.txt
(virtualenv)~/py-arduino$

Create a virtualenv

Install required libraries

Step 3: open the sketch and upload

Open the sketch at py-arduino/sketches/py_arduino/py_arduino.ino, verify and upload to Arduino.

Arduino sketch

Step 4: test it

(virtualenv)~/py-arduino$  python -m py_arduino.cli.ping /dev/ttyACM0
Ping sent... OK - Time=18.295 ms
Ping sent... OK - Time=19.658 ms
Ping sent... OK - Time=23.358 ms
^C
(virtualenv)~/py-arduino$

Test it

Use it!

See: How to use py_arduino.cli.*.

Common problems

If you have problems, check Common problems, file a bug or contact me.