Lesson 1 - Intro to Arduino and Blink
Lesson 1 - Intro to Arduino and Blink
Topics:
The Arduino
Digital IO
Analog IO
Setup
• Go to
http://arduino.cc/en/Guide/HomePage
1. Download & install the Arduino
environment (IDE)
Meet Arduino Uno
Arduino
What and Why?
• https://www.youtube.com/watch?v=CSx6k-zX
lLE&t=1s
Meet Arduino Uno
PWR IN USB
(to Computer)
RESET
SCL\SDA
(I2C Bus)
POWER
5V / 3.3V /
GND
Digital I\O
PWM(3, 5, 6, 9, 10,
11)
Analog
INPUTS
Getting Started
analogWrite()
digitalRead()
if() statements /
Boolean
analogRead()
Serial communication
This work is licensed under a
Creative Commons Attribution-ShareAlike 3.0 United States License.
Arduino Digital I/0
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
Concepts: INPUT vs.
OUTPUT
Referenced from the perspective of the
microcontroller (electrical board).
void setup()
{
// runs once
}
void loop()
{
// repeats
error & status messages }
PinMode
digitalWrite(13, HIGH);
// Makes the output voltage on pin 13 ,
5V
delay(1000);
// time for previous command is 1000
ms
Comments, Comments,
Comments
Comments are for you – the programmer and
your friends…or anyone else human that might
read your code.
As an Output
Function
Pin to be set
Experimenting with your Program
Congratulations!!!