Python and Arduino A Tale of Snakes and Kings
Python and Arduino A Tale of Snakes and Kings
Alessandro Pasotti
a.pasotti@itopen.it
@elpaso
Davide Corio
davide.corio@domsense.com
@davidecorio
Introduction
who
why
what
In the beginning
In the beginning was the abacus...
Technology started on real things
you could touch
Being digital
From Big-Blue to Micro-Soft
Leaving Earth
Abstraction can be
addictive
Unusable interfaces
Being real
Physical computing: low cost MCU's and
electronic components
What's inside?
hw: device: electronic prototyping board
sw: bootloader
sw: libraries
sw: IDE
community
lot of manuals
lot of examples
The board
Arduino UNO
MCU
Atmega 328
RAM 2 KB
ROM 32 KB
EEPROM 1 KB
14 digital pins
6 PWM capable
6 analog inputs
Up to 16 MHz
avr-gcc
Pins
Digital IO
PWM (digital)
Analog inputs
Logical 0
255 levels
Logical 1
C programming
Programming
setup
loop
blink!
King's audience
Arduino talks and listens
serial
sensors
RF
ethernet
DIY Arduino
< 10
Snake's attack
ASCII messages
compact protocols
a
-D
t
:
a
!
!
rm orks
i
f
y
p
w
t
t
r
i
o
,
p
m " y eah
i
>
>> print
>>>
"
ASCII snake
>>> import serial
>>> ser = serial.Serial('/dev/ttyACM0', 9600)
>>> while 1:
... ser.readline()
'1 Hello world!\r\n'
'2 Hello world!\r\n'
'3 Hello world!\r\n'
PyFirmata example
Embedded snakes
Python on a chip
http://code.google.com/p/python-on-a-chip/
Other projects
Python Arduino Prototyping API
https://github.com/HashNuke/Python-Arduino-Prototyping-API
Python 2B (ASCII protocol)
http://arduino.cc/playground/Code/2B
https://github.com/elpaso/arduinocontroller
http://www.youtube.com/watch?feature=player_embedded&v=MkxK9bHPZxQ
THANKS!
Alessandro Pasotti
a.pasotti@itopen.it
@elpaso
Davide Corio
davide.corio@domsense.com
@davidecorio