Desenvolvendo Projetos Interativos com Arduino
Álvaro Justen aka Turicas
Álvaro Justen aka Turicas
{twitter.com,
github.com,
bitbucket.org}/turicas
blog.justen.eng.br
alvaro@CursoDeArduino.com.br
www.CursoDeArduino.com.br
emap.fgv.br
Arduino?
Talk is cheap, show me the code!
#define LED 13 void setup() { pinMode(LED, OUTPUT); Serial.begin(9600); } void loop() { if (Serial.available()) { char c = Serial.read(); if (c == 'H') { digitalWrite(LED, HIGH); } else if (c == 'L') { digitalWrite(LED, LOW); } } }
#!/usr/bin/env python import serial import time # /dev/ttyACM0 = Arduino Uno on Linux arduino = serial.Serial('/dev/ttyACM0', 9600) time.sleep(2) #waiting the initialization... arduino.write('H') #turns LED *on* time.sleep(3) #zzz arduino.write('L') #turns LED *off* time.sleep(3) #zzz arduino.close() #let's say goodbye
{twitter.com,
github.com,
bitbucket.org}/turicas
blog.justen.eng.br
alvaro@CursoDeArduino.com.br
www.CursoDeArduino.com.br
turicas.info/slides/arduino