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
OS Language #Runs Last Run Cov%
macOS 14.5 Python 3.10 - - -
macOS 15.5 Python 3.12 20 2025-08-06 40.0%
macOS 15.6 Python 3.12 52 2026-07-14 40.0%
macOS 26.6 Python 3.12 9 2026-08-11 0.0%
macOS 26.6.1 Python 3.12 12 2026-09-04 40.0%
win32 Windows 11 Python 3.12 99 2026-09-05 39.4%
Ubuntu 20.04 focal Python 3.10 - - -
Ubuntu 22.04 jammy Python 3.10 - - -
Ubuntu 24.04 noble Python 3.10 30 2025-05-27 39.4%
Ubuntu 24.04 noble Python 3.12 124 2026-09-05 39.4%

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 sample for a sample python app to communicate with the Arduino
  • See the README.md for more instructions on running the sample python script.
  • See the src/pycro_hal for the HAL interface python scripts
  • See the doc/comm_protocol.md in pycro-hal for the full communication protocol.

- John Arrizza