Call Girls in Gomti Nagar - 7388211116 - With room Service
Build cool stuff with arduino for sci camp 16 dec13
1. Build cool
stuff with
Arduino
William Hooi
Wendell Wong
Centre for Research & Applied Learning in
Sciences
Science Centre Singapore
Introductory
Workshop
13 Dec 2013
facebook.com/CRADLEsci
5. Terminology
• Pins
– A leg on a microcontroller with some specific
function (e.g. Power pin, ground pin, digital input
pin, analog output pin)
Digital pins
Arduino has 13 digital pins that can be used
as input or output
Arduino has 6 analog pins that can only be
used as input
Analog pins
9. Where to start
Determine your
input
Output device:
Determine your
output and device
Input device:
Choose a device
Lightdependent
resistor
(LDR)
Light
emitting
diode (LED)
Piezo
buzzer
15. Activity 2: ..and beep a buzzer
Assign pin 8 as tone pin
Play a tone on tone pin with 200 Hz and 250ms
Play a tone on tone pin with 600 Hz and 250ms
25. Reading from serial monitor
#include <Servo.h>
create a servo object called ‘myservo’
Start serial comm at 9600bps
Assign servo to servo pin 9
Read analog pin 0, pass value to potLevel
Convert range to 180 divisions
Display something on serial monitor
Tell servo to rotate