A (Very) Short Course On Arduino - Handout
A (Very) Short Course On Arduino - Handout
Arduino Workshop
JAN RAY C. RULIDA
Welcome to this
workshop!
Voltage
Resistance
Computer Programming
sequence
Computer Programming
1.
2.
3.
Logic/Bitwise
Operations
NOT
AND
OR
XOR (Exclusive OR)
Bitwise Symbol
Logic Symbol
~
&
|
^
!
&&
||
OUTPUT of !(INPUT)
False
True
False
True
True
False
True
False
INPUT 2
OUTPUT of (INPUT1
&& INPUT2)
False
False
False
False
True
False
True
False
False
True
True
True
INPUT 2
OUTPUT of (INPUT1
|| INPUT2)
False
False
False
False
True
True
True
False
True
True
True
True
Symbol
+
*
/
%
What is Arduino?
What is Arduino?
A Physical Piece of Hardware
A Programming Environment
What is Arduino?
USB
Microcontroller ATmega328
Operating Voltage 5V
Input Voltage (recommended)7-12V
Input Voltage (limits)6-20V
Digital I/O Pins 14
(of which 6 provide PWM output)
Analog Input Pins 6
DC Current per I/O Pin 40 mA
DC Current for 3.3V Pin 50 mA
7-12 v
3 v GND
5v
Lets Begin!
Run the installer and just follow the prompts and choose the
defaults presented by the installer
From
From
Open
Congratulations! Youve
programmed your first
microcontroller!
Arduino Terminology:
Arduino Sketch!
comments
v
functions
Arduino Sketch!
variable
to 1023 on pins A0 to
A5. This means an input voltage between 0 to 5 volts on
pins A0 to A5 will mapped to integer values between 0 to
1023.
analogWrite(pin,
value)
pinMode(pin, mode)
Sets pin to either INPUT or OUTPUT
digitalRead(pin)
Reads HIGH or LOW from a pin
digitalWrite(pin, value)
Writes HIGH or LOW to a pin
Electronic stuff
Output pins can provide 40 mA of current
Writing HIGH to an input pin installs a 20K pullup
You can also stick cables directly into the Vin and GND
(Ground) pins to power the board from 712 volts great if
you dont have a barrel plug on your power source.
LED Adventures!
A light-emitting
diode (LED) is a
semiconductor device
that emits visible light
when an electric current
passes through it.
Safety Check!!!
Always
LED Adventures!
Connect an LED as shown
on the left.
LED Adventures
Add a RESISTOR!
Add a RESISTOR!
Breadboard!!!
Breadboard!!!
Digital Input/Output:
File->Examples->03. Analog->AnalogInput. It
uses analogRead(...) to read the voltage on A0, and
turns the LED on and off with a delay determined by
that voltage the further right you turn the knob, the
slower the LED will blink.
analogRead()
Upload
Arduino Shields!!!
Shields
Character LCD
Character LCD
Disconnect
USB. Open up
the FileExamplesLiquidCrystalHelloWorld
example sketch
Upload the sketch to your Arduino Board.
Thank You!