Windows 7 (64bits)
Arduino IDE 1.0.5 for Linux (32bits)
Arduino IDE 1.5.7 for Windows
Status:
- 2014.09.14 It's working.
- sudo apt-get update
- sudo apt-get install arduino openjdk-6-jre gcc-avr avr-libc
- Plug and Check if Arduino device was detected (ttyACM0: USB ACM device):
- lsusb
- dmesg | grep tty
- Download Arduino IDE.
- Extract to /~ folder.
Setting the Permission on ttyACM0 (Linux only - All distro):
- Check the owner group of the serial port:
- ls -l /dev/ttyACM0
- You will get something like "dialout" or "uucp".
- Add our user (pi) to that group:
- usermod -a -G dialout pi
- Add our user (pi) to "lock" group (if you have filesystem-2012.6-2 or newer):
- usermod -a -G lock pi
Installing on Windows:
- Donwload and run Python for Windows.
- Download and Install PySerial:
- Download PySerial from http://pypi.python.org/pypi/pyserial. Unpack, enter the pyserial-x.y directory (DOS) and run the command bellow:
- python setup.py install
- Download Arduino IDE for Windows.
Testing - Linux and Windows:
- Double click on /~/arduino-1.0.5/arduino and choose "Run" (arduino.exe on Windows).
- Select a serial port (menu: Tools->Serial Port->dev/ttyACM0) (COM4 on Windows).
- If there is no serial port available then try one of those options.
- Select a board (menu: Tools->Board->Arduino Uno).
- See examples (menu: File->Sketchbook).
- Open file serial_echo.ino with Arduino IDE and Upload.
Testing with Python:
- We don't need any privileges, like when working with Arduino IDE (chmod 777 /dev/ttyACM0).
- python
- import serial
- On Linux:
- ser=serial.Serial(port='/dev/ttyACM0', baudrate=500000, timeout=1)
- On Windows:
- ser=serial.Serial(port='COM4', baudrate=500000, timeout=1)
- ser.write('Testing...\n')
- print ser.readline()
- ser.close()
References: