Python – Communicating with the Arduberry

Python – Communicating with the Arduberry

This is a tutorial to get you started with sending and receiving the data, to and from the Arduberry, directly from the ease of your Python program.

Step 1: Setting up the Raspberry Pi

Follow the Getting Started to Arduberry guide and run the install script to set up the libraries for the Arduberry.

Step 2: Upload the sketch to Arduberry

Open the Arduino IDE on the Raspberry Pi, and open the serial_arduberry.ino in the Arduberry Github Repository .

arduino_prog

Choose the programmer as Raspberry Pi GPIO and the board as Arduino Uno.  

To upload the sketch to the Arduberry, use “Upload as a Programmer” or press “Ctrl+Shift+U“.

upload4Step 3: Run the Python program

We have created a sample Python program which sends a command to the Arduberry and reads a string and an analog value back from the Arduberry.

Run the Python program and the data should start coming on the terminal:

python pySer.py

python_op
You can modify this program and the Arduino sketch to send or receive any data, to and from your Python program.

Question?  Ask on the forums and we’ll help you out.