User Tools

Site Tools

Site Tools



To communicate with the Arduino, the best way I found is to simply use Python. All other methods do not work on all systems, especially on Ubuntu based linux. I found this solution here :

When you have loaded the program into your arduino, stop the IDE (only one program can listen on Serial at a time), and launch python. Then, you can listen on Serial port for Arduino using :

import serial
ser = serial.Serial("/dev/ttyUSB0", 9600)
while True:
   print ser.readline()

By replacing /dev/ttyUSB0 by your local interface. In my case, the interface was /dev/ttyMAC0 or /dev/ttyMAC1. You are now free to record your arduino output into a file on your PC or something else, Python is one of the most complete language. If you get “Cannot open /dev/ttyACM0: Permission denied”. or something like that, it means that you are not a member of dialout group. On Debian base linux, use :

sudo adduser myuseraccount dialout

Log out and login, or simply reboot, and you are done with.


Light sensors


int photoRPin = 0; 
int lightLevel;

void setup() {



void loop(){