Arduino Analog Input Data Sent To Python

GroG's picture

To retrieve analog data from an Arduino and send it back into Python for further processing the following script should work.

On every pin value change event a new Pin object is sent from Arduino to Python.

The is the number of the pin whose value has changed - this is necessary so you map poll multiple pins at the same time.

pin.value is the value from the pin - for analog pins its 0-1023

pin.source is the Arduino's name for which the pin came from (if there are multiple Arduinos)

3 MakerFaire Projects

Alessandruino's picture

InMoov Head



head will track with both eyes and neck using 3 PID - it will have manual mode with joystick ?


  • 3 Servos
  • Arduino
  • Netbook


Powering Pi Robots

DJUltis's picture

Alessandruino, this is for you. I noticed in the shoutbox that you were questioning how to properly power a Pi for robotics. 

So I've been working on the same thing and hope this info might give you a lot of help. 


Bill of materials:

- 2 or 3 cell Lipo Battery 3000mAh or above (I've been using a 5000mAh)

-USB Hub (I use one with a 5V 2A input)

-USB Micro cable (cheap cheap cheaper the better)

AdafruitMotorShield Service


The  Adafruit Motor Shield is a service which will create a number of sub services.  It will create 4 Motor, 2 Servo, and 1 Arduino service.  This shield uses its own library, so MRLComm.ino will need to be modified.
Fortunately, the Arduino service will have the modified MRLComm.ino pre loaded in its editor.  This will need to be compiled & uploaded into the Arduino.



Network Problems

GroG's picture is hosted on Amazons AWS cloud services - guess where ? :(

InMoov / Python Service WORKY ! - Build 1694

GroG's picture

The Python service had a bug which did not allow callbacks from other Services.  Listeners could be set up which were supposed to call different methods in Python, but ended up only calling the first called method.

an Example would be :