Chapter 1
Chapter 1
Chapter 1
II(Buggy)
Course Introduction
CGVR
Evaluation Criteria:
Quizzes
Lab Evaluation
Demonstration of Three different Challenges (Bronze, Silver and
Gold)
End Term Exam
Resources
CGVR
http://www.tutorialspoint.com/arduino/
https://www.arduino.cc/en/Tutorial/HomePage
https://www.tutorialspoint.com/csharp/
http://www.completecsharptutorial.com/
What is a Microcontroller
CGVR
www.mikroe.com/chapters/view/1
Making-robots-with-arduino.pdf
The Arduino Microcontroller:
Atmel ARV Atmega 328 CGVR
Specification
Making-robots-with-arduino.pdf
What is the Arduino
CGVR
todbot.com/blog/bionicarduino
What is an Arduino ?
CGVR
todbot.com/blog/bionicarduino
Arduino IDE
CGVR
todbot.com/blog/bionicarduino
CGVR
todbot.com/blog/bionicarduino
Add an External LED to pin 13
CGVR
www.instructables.com
A Little Bit About Programming
CGVR
• Code is case
sensitive
• Statements are
commands and
must end with a
semi-colon
• Comments follow
a // or begin with /*
and end with */
• loop and setup
Our First Program
CGVR
Terminology
CGVR
Digital I/0 CGVR
www.mikroe.com/chapters/view/1
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
Arduino Timing
CGVR
• delay(ms)
– Pauses for a few milliseconds
• delayMicroseconds(us)
– Pauses for a few microseconds
Digital? Analog?
CGVR
todbot.com/blog/bionicarduino
Variables
CGVR
Putting It Together
CGVR
• Complete the sketch
(program) below.
• What output will be
generated by this program?
• What if the schematic were
changed?
www.ladyada.net/learn/arduino
Analog to Digital Coversion
CGVR
What is analog ?
It is continuous range of voltage values (not just
0 or 5V)
analogWrite(2,128);