Overview
| module url | N/A | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| git repository | https://bitbucket.org/arrizza-public/pycro-arduino | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| git command | git clone git@bitbucket.org:arrizza-public/pycro-arduino.git | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| verification report | https://arrizza.com/web-ver/pycro-arduino-report.html | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| version info |
|
- copyright: Copyright and License
- repo status: Repo Information
- installation: Common Setup
Summary
A python interface to a microcontroller with a Hardware Abstraction Layer (HAL).
This module allows a python script to control an Arduino. It read or write any of the Digital or Analog pins. Use the python module pycro-hal source to communicate with an Arduino flashed with pycro-arduino.
See pycro page for the full communications protocol or the doc/comm_protocol.md in pycro-hal repo.
See arduino template for using zpm for arduinos
Build it
Currently only tested on an Arduino Nano board. You can try it on other Arduinos by changing this line in gen.py
sh1.set_boardid('nano-atmega328old')
Change gen.py with the correct serial/UART port name:
port = 'dev/ttyUSB0'
# or use the USB id for that port (works cross-platform)
port = alamake.get_port('1A86:7523')
# set the port
sh1.set_avrdude_port(port)
zpm mk-gen # gen the Makefile
zpm mk-build # build the app
Run it
zpm mk-upload # upload to the arduino
Run the python script to execute commands on the Arduino.
- See Pycro HAL for more information.
- See the
samplefor a sample python app to communicate with the Arduino - See the
README.mdfor more instructions on running the sample python script. - See the
src/pycro_halfor the HAL interface python scripts - See the
doc/comm_protocol.mdin pycro-hal for the full communication protocol.