GR 7 Robotics - Lesson 6 - Intro To Arduino and Blink
GR 7 Robotics - Lesson 6 - 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
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
Meet Arduino Uno
Arduino
What and Why?
• https://www.youtube.com/watch?v=CSx6k-
zXlLE&t=1s
Getting Started
analogWrite()
digitalRead()
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, LOW);
// Makes the output voltage on pin 13 , 0V
digitalWrite(13, HIGH);
// Makes the output voltage on pin 13 , 5V
delay(1000);
// time for previous command is 1000 ms
Comments, Comments, Comments
As an Output
Function
Pin to be set
Experimenting with your Program