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

py_arduino.cli.*: Reference

You can see the source code here.

ping

To check the connectivity to the Arduino

$ python -m py_arduino.cli.ping /dev/ttyACM0

Default invocation

$ python -m py_arduino.cli.ping /dev/ttyACM0

Ping

Showing logging's info messages

$ python -m py_arduino.cli.ping --info /dev/ttyACM0

Ping --info

Showing logging's debug messages

$ python -m py_arduino.cli.ping --debug /dev/ttyACM0

Ping --debug

ipython

Start an IPython interactive session.

$ python -m py_arduino.cli.ipython /dev/ttyACM0

To use this, you'll need to install ipython with:

$ pip install ipython

Here you can see the interactive session with a customized message. The sessions starts with the Arduino connected.

IPython

In this example, we import some constants, set the PIN 13 to OUTPUT mode, and write a LOW first, and then a HIGH.

IPython - Use onboard LED on pin 13

Here is a short video showing how to use ipython, and how to dim the onboard LED of Arduino using PWM.

analog_read

TODO: add documentation! But you can see the source code.

analog_write

TODO: add documentation! But you can see the source code.

digital_read

TODO: add documentation! But you can see the source code.

digital_write

TODO: add documentation! But you can see the source code.