SlideShare a Scribd company logo
Intro to Arduino Class	

!
Deezmaker 3D Printer Store and Hackerspace	

Taught by Quin Etnyre	

July 26, 2014
Thank you to SparkFun for sharing
the original presentation!
What is Open Source?
• Release your design files to the public	

• Free access for anyone who wants to learn	

• Everyone gains knowledge, companies or
hobbyists	

• You are able to remake/remix the project to suit
your own needs	

• When you credit the original designer
What is the Arduino?
Intended for anyone to create interactive projects	

“Strong Friend” Created in Ivrea, Italy 	

in 2005 by Massimo Banzi & David Cuartielles	

Open Source Hardware	

Atmel 8-Bit Processor	

Coding is easy for anyone to learn
Why do I want an Arduino?
Arduino is a 8-bit prototyping system that is
easy for the modern developer, designer, hacker,
kid, or someone that has no experience in this
type of genre to use.	

!
But why is important to all of us?
Schedule
• Introduction to Arduino and Installing Software	

• Project 1	

• Electronics Concepts	

• Project 2	

• Arduino IDE in Depth	

• Project 3	

• Break	

• Project 4	

• Explaining More Code	

• Project 5, 6, & 7	

• ProjectTime with more ArduSensors
Kit Contents
Intro to Arduino Revision #2
Arduino IDE
The Arduino IDE (Integrated Development
Environment) is where we develop our code,
and upload the code to the Arduino Leonardo
board. You can download the latest software
here:	

!
Arduino 1.0.5: 	

bit.ly/arduinoide
Downloading Code
!
bit.ly/deezmakercode	

!
Put the downloaded folder on your
desktop
Arduino Drivers
Mac:	

 	

 	

 	

 	

 	

 	

 	

 	

 Click Red ‘X’	

!
!
Windows XP / 7 / 8:	

!
!
!
Windows XP / 7 Secondary Option: http://bit.ly/
arduino-windows
Intro to Arduino Revision #2
Intro to Arduino Revision #2
Board Type
Serial Port / COM Port
Which COM/Serial Port?
Mac: /dev/tty.usbmodemfd131
!
Interchangeable #: 
!
Windows: COM#
Device Manager:
!
Start>Control
Panel>System &
Security>Device 
Manager>Ports
What’s a Breadboard?
Circuit 1: Basic Blink
19
Add more LEDs!
Arduino Shields
LCDTouch RGB LED WiFi
ArduSensors - ‘Mini Shields’
Concepts of Electronics
• Polarity	

• Power /Voltage and Ground	

• Analog and Digital	

• Inputs and Outputs	

• PWM	

• Arduino IDE Review	

• Analog Inputs
Polarity
Polarity is when there are two or more different
sides (or leads) of a component that have
different qualities that can not be reversed.	

!
Examples: batteries, LEDs, buttons
Power / Voltage and Ground
(GND)
Use only 5V or 3.3V in your projects
Power
+
-
Circuit
Analog and Digital
• All Arduino signals are either Analog or Digital 	

• All computers can only understand Digital	

• Digital Pins D0 - D13 on Arduino	

• Special pins that are ADC enabled (analog to
digital converter) we can connect sensors to	

• Analog Pins A0 - A5 on Arduino
I/O, or Input/Output
Input is any signal 	

entering an electrical 	

system/Arduino.	

!
Output is any signal 	

exiting an electrical 	

system.
Output
Output is always Digital	

!
To Output a Digital signal (On or Off) use this code: 	

	

!
digitalWrite (pinNumber, value);
!
Where value is HIGH (on) or LOW (off), both in caps
Output
To ‘Fade’ an LED or to output a voltage in-between 0V and 5V,
use PWM	

!
Use this code to output an ‘analog’ signal:	

analogWrite (pinNumber, value); 	

Where value is a number 0 - 255. (0V to 5V)	

!
PWM is available on Arduino Leonardo digital pins 3, 5, 6, 9,
10, 11, and 13, and marked with a ‘~’.
Output
Output is always Digital, even when it’s P.W.M.
!
For P.W.M. the Arduino pin turns on, then off very fast
!
!
P.W.M. Signal @ 25%
 
 
 P.W.M. Signal @ 75%

 P.W.M. Signal
rising
Circuit 2:
31
Arduino IDE in Depth
• Parts of the Sketch	

• setup()	

• loop()	

• Comments	

• Analog Input
Parts of the Sketch
void setup() {}
34
!
!
void loop ( ) { }
!
!
!
!
!
!
!
!
Example of Comment:
Comments
• Comments are ignored by the compiler/
verifier	

• Comments can be anywhere	

• Starts with a // for a one-line comment 	

• Starts with a /* and ends with a */ for a
multiple-line comment	

• Great ways to remind you what you did, teach
other people what that code means
Analog Input
• To connect an analog Input to your Arduino, use
Analog Pins #A0 - A5	

!
• To get an analog reading, use the code: 	

	

 analogRead(pinNumber);	

!
• Analog Input varies from 0 to 1023 on an Arduino
Circuit 3: Analog Reading
Intro to Arduino Revision #2
Break
Digital Sensors/Digital Input
• Digital Input could be a switch or a button	

• To connect digital input to your Arduino use Digital
Pins # D0 – D13	

• Digital Input needs a pinMode command (in setup):	

	

 pinMode(pinNumber, INPUT); 	

	

 Make sure to use caps for INPUT	

• To get a digital reading: digitalRead(pinNumber);	

• Digital Input values are only HIGH (On) or LOW
(Off)
Digital Sensors/Digital Input
• Digital sensors are more straight forward than
Analog	

!
• No matter what the sensor, there are only two
settings: On and Off	

!
• Voltage signal for LOW (off) will be 0V, and HIGH
(on) will be 5V
Parts for Circuit 4:
Arduino Leonardo	

Breadboard	

Pushbutton (2)	

LED (2)	

Resistor - 10K Ohm (2)	

Resistor - 330 Ohm (2)	

Jumper Wires
Circuit 4: Buttons
Intro to Arduino Revision #2
`
Intro to Arduino Revision #2
Operators
The equals sign	

!
= is used to assign a value	

!
== is used to compare values	

!
&& is “and”	

!
|| is “or”
Variables
Basic variable types:	

!
Boolean (on or off)	

Integer (a number)	

Character (a letter)	

String (a phrase)
Declaring Variables
Boolean: boolean variableName;	

!
Integer: int variableName;	

!
Character: char variableName;	

String: stringName [ ];
Assigning Variables
Boolean: variableName = true;	

or variableName = false;
Assigning Variables
Boolean: variableName = true;	

or variableName = false;	

Integer: variableName = 32767;	

or variableName = -32768;
Assigning Variables
Boolean: variableName = true;	

or variableName = false;	

Integer: variableName = 32767;	

or variableName = -32768;	

Character: variableName = ‘A’;	

or stringName = “Deezmaker”;
Circuit 5: ArduSensor + LED
Intro to Arduino Revision #2
Setup

void setup ( ) { 

pinMode (13, OUTPUT); }
!
!
!
Inputs & Outputs are declared in
setup, this is done by using the
pinMode function
This particular example declares digital pin # 13 as
an output, remember to use CAPS
!
!
If Statements
if ( this is true ) { do this; }
!
!
!
!
!
!
Basic Repetition
!
for (int count = 0; count<10; count++)
{
//for action code goes here
//this could be anything
}
Circuit 6: LED Bounce
Intro to Arduino Revision #2
Intro to Arduino Revision #2
Circuit 7: Meter
Intro to Arduino Revision #2
Intro to Arduino Revision #2
ProjectTime with more
ArduSensors

More Related Content

What's hot (20)

PDF
Arduino learning
Anil Yadav
 
PPTX
Arduino slides
sdcharle
 
PDF
Arduino spooky projects_class1
Felipe Belarmino
 
PDF
IOTC08 The Arduino Platform
Eoin Brazil
 
PDF
Arduino electronics cookbook
Felipe Belarmino
 
PDF
From Arduino to LinnStrument
Geert Bevin
 
PPTX
Porte à puce - Automatic Door based on Arduino UNO R3
Meifani Sumadijaya
 
PDF
Introduction to Arduino Programming
James Lewis
 
PPTX
Smart Safety Door with Servo Motors as Actuators, Passcode and DHT Sensors B...
Faqih Fadhila Ardiansyah
 
PPTX
Porte à puce - Smart Safety Door based on Arduino UNO R3
Meifani Sumadijaya
 
PDF
Cassiopeia Ltd - standard Arduino workshop
tomtobback
 
PPTX
Introduction to Arduino Microcontroller
Mujahid Hussain
 
PDF
Introduction to Arduino
Luki B. Subekti
 
PPTX
Arduino Day 1 Presentation
Yogendra Tamang
 
PPTX
Introduction to arduino
Ahmed Sakr
 
PDF
Arduino Lecture 1 - Introducing the Arduino
Eoin Brazil
 
PPTX
Arduino
Jerin John
 
PDF
Getting startedwitharduino ch04
Anil Yadav
 
PPTX
02 General Purpose Input - Output on the Arduino
Wingston
 
PDF
Arduino 8-step drum sequencer 3 channels
tomtobback
 
Arduino learning
Anil Yadav
 
Arduino slides
sdcharle
 
Arduino spooky projects_class1
Felipe Belarmino
 
IOTC08 The Arduino Platform
Eoin Brazil
 
Arduino electronics cookbook
Felipe Belarmino
 
From Arduino to LinnStrument
Geert Bevin
 
Porte à puce - Automatic Door based on Arduino UNO R3
Meifani Sumadijaya
 
Introduction to Arduino Programming
James Lewis
 
Smart Safety Door with Servo Motors as Actuators, Passcode and DHT Sensors B...
Faqih Fadhila Ardiansyah
 
Porte à puce - Smart Safety Door based on Arduino UNO R3
Meifani Sumadijaya
 
Cassiopeia Ltd - standard Arduino workshop
tomtobback
 
Introduction to Arduino Microcontroller
Mujahid Hussain
 
Introduction to Arduino
Luki B. Subekti
 
Arduino Day 1 Presentation
Yogendra Tamang
 
Introduction to arduino
Ahmed Sakr
 
Arduino Lecture 1 - Introducing the Arduino
Eoin Brazil
 
Arduino
Jerin John
 
Getting startedwitharduino ch04
Anil Yadav
 
02 General Purpose Input - Output on the Arduino
Wingston
 
Arduino 8-step drum sequencer 3 channels
tomtobback
 

Viewers also liked (20)

PPT
Intro to Arduino
avikdhupar
 
KEY
Hello Arduino.
mkontopo
 
PDF
morning!, by Mia Diwasasri
Sari Asih
 
PDF
Introduction to Arduino @ Open Tech School - Berlin (6 Dec 2012)
Alessandro Contini
 
PPTX
Introducción a Arduino r2
Marino Linaje Trigueros
 
PDF
Is Computer Science Science?
Daniel Cukier
 
PPT
Computer science -
RAKSHA SRIVASTAVA
 
PPTX
Intro Inteligencia Artificial (AI)
Iván Sanchez Vera
 
PPTX
Intro to Artificial inteligence
Zeeshan Tariq
 
PPTX
Arduino Intro Guide 2
elketeaches
 
PDF
AI A Slight Intro
Omar Enayet
 
PDF
Fields in computer science
UC San Diego
 
PDF
Arduino practicas
Rafael Eduardo G
 
PDF
Intro arduino English
SOAEnsAD
 
PDF
Raspberry Pi - Introduzione, caratteristiche, programmazione, casi d'uso
gianlucaghettini
 
PDF
Introduction to Embedded System
Zakaria Gomaa
 
PPTX
Artificial Intelligence
falepiz
 
DOCX
Manual basico de practicas con Arduino uno
Ramiro Hernandez Michua
 
ODP
Introduction to Arduino
Richard Rixham
 
Intro to Arduino
avikdhupar
 
Hello Arduino.
mkontopo
 
morning!, by Mia Diwasasri
Sari Asih
 
Introduction to Arduino @ Open Tech School - Berlin (6 Dec 2012)
Alessandro Contini
 
Introducción a Arduino r2
Marino Linaje Trigueros
 
Is Computer Science Science?
Daniel Cukier
 
Computer science -
RAKSHA SRIVASTAVA
 
Intro Inteligencia Artificial (AI)
Iván Sanchez Vera
 
Intro to Artificial inteligence
Zeeshan Tariq
 
Arduino Intro Guide 2
elketeaches
 
AI A Slight Intro
Omar Enayet
 
Fields in computer science
UC San Diego
 
Arduino practicas
Rafael Eduardo G
 
Intro arduino English
SOAEnsAD
 
Raspberry Pi - Introduzione, caratteristiche, programmazione, casi d'uso
gianlucaghettini
 
Introduction to Embedded System
Zakaria Gomaa
 
Artificial Intelligence
falepiz
 
Manual basico de practicas con Arduino uno
Ramiro Hernandez Michua
 
Introduction to Arduino
Richard Rixham
 
Ad

Similar to Intro to Arduino Revision #2 (20)

PPTX
Arduino Slides With Neopixels
sdcharle
 
PPTX
teststststststLecture_3_2022_Arduino.pptx
ethannguyen1618
 
PDF
Arduino microcontroller ins and outs with pin diagram
ArifatunNesa
 
PPT
13223971.ppt
SuYee13
 
PPTX
arduino and its introduction deep dive ppt.pptx
SruSru1
 
PPTX
Arduino.pptx
AadilKk
 
PPT
arduino Simon power point presentation.ppt
JuniorAsong
 
PPT
arduinoSimon.ppt
Kishor Mhaske
 
PPT
arduinoSimon.ppt
ZainIslam20
 
PPT
arduinoSimon.ppt
AkhandPratapSingh86
 
PDF
Introduction to arduino
Jawaher Abdulwahab Fadhil
 
PDF
The IoT Academy IoT training Arduino Part 1 basics
The IOT Academy
 
PPT
ArduinoSectionI-slides.ppt
Lam Hung
 
PPTX
Arduino Workshop Slides
mkarlin14
 
PPTX
Arduino course
Ahmed Shelbaya
 
PPTX
Arduino intro.pptx
AlexRiv4
 
PDF
arduinocourse-180308074529 (1).pdf
ssusere5db05
 
PPTX
Introduction to Arduino Webinar
Fragiskos Fourlas
 
PDF
The document proceeds to explain the main components of an Arduino Uno board ...
QucngV
 
PPS
What is Arduino ?
Niket Chandrawanshi
 
Arduino Slides With Neopixels
sdcharle
 
teststststststLecture_3_2022_Arduino.pptx
ethannguyen1618
 
Arduino microcontroller ins and outs with pin diagram
ArifatunNesa
 
13223971.ppt
SuYee13
 
arduino and its introduction deep dive ppt.pptx
SruSru1
 
Arduino.pptx
AadilKk
 
arduino Simon power point presentation.ppt
JuniorAsong
 
arduinoSimon.ppt
Kishor Mhaske
 
arduinoSimon.ppt
ZainIslam20
 
arduinoSimon.ppt
AkhandPratapSingh86
 
Introduction to arduino
Jawaher Abdulwahab Fadhil
 
The IoT Academy IoT training Arduino Part 1 basics
The IOT Academy
 
ArduinoSectionI-slides.ppt
Lam Hung
 
Arduino Workshop Slides
mkarlin14
 
Arduino course
Ahmed Shelbaya
 
Arduino intro.pptx
AlexRiv4
 
arduinocourse-180308074529 (1).pdf
ssusere5db05
 
Introduction to Arduino Webinar
Fragiskos Fourlas
 
The document proceeds to explain the main components of an Arduino Uno board ...
QucngV
 
What is Arduino ?
Niket Chandrawanshi
 
Ad

Recently uploaded (20)

PDF
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PDF
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
PPTX
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
PPT
Ericsson LTE presentation SEMINAR 2010.ppt
npat3
 
PDF
The 2025 InfraRed Report - Redpoint Ventures
Razin Mustafiz
 
PDF
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PDF
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
DOCX
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
PDF
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
PDF
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
PPTX
Seamless Tech Experiences Showcasing Cross-Platform App Design.pptx
presentifyai
 
PPTX
Agentforce World Tour Toronto '25 - Supercharge MuleSoft Development with Mod...
Alexandra N. Martinez
 
PDF
“Squinting Vision Pipelines: Detecting and Correcting Errors in Vision Models...
Edge AI and Vision Alliance
 
PDF
NASA A Researcher’s Guide to International Space Station : Physical Sciences ...
Dr. PANKAJ DHUSSA
 
PDF
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
PDF
AI Agents in the Cloud: The Rise of Agentic Cloud Architecture
Lilly Gracia
 
PPTX
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
PDF
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
Ericsson LTE presentation SEMINAR 2010.ppt
npat3
 
The 2025 InfraRed Report - Redpoint Ventures
Razin Mustafiz
 
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
Seamless Tech Experiences Showcasing Cross-Platform App Design.pptx
presentifyai
 
Agentforce World Tour Toronto '25 - Supercharge MuleSoft Development with Mod...
Alexandra N. Martinez
 
“Squinting Vision Pipelines: Detecting and Correcting Errors in Vision Models...
Edge AI and Vision Alliance
 
NASA A Researcher’s Guide to International Space Station : Physical Sciences ...
Dr. PANKAJ DHUSSA
 
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
AI Agents in the Cloud: The Rise of Agentic Cloud Architecture
Lilly Gracia
 
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 

Intro to Arduino Revision #2

  • 1. Intro to Arduino Class ! Deezmaker 3D Printer Store and Hackerspace Taught by Quin Etnyre July 26, 2014
  • 2. Thank you to SparkFun for sharing the original presentation!
  • 3. What is Open Source? • Release your design files to the public • Free access for anyone who wants to learn • Everyone gains knowledge, companies or hobbyists • You are able to remake/remix the project to suit your own needs • When you credit the original designer
  • 4. What is the Arduino? Intended for anyone to create interactive projects “Strong Friend” Created in Ivrea, Italy in 2005 by Massimo Banzi & David Cuartielles Open Source Hardware Atmel 8-Bit Processor Coding is easy for anyone to learn
  • 5. Why do I want an Arduino? Arduino is a 8-bit prototyping system that is easy for the modern developer, designer, hacker, kid, or someone that has no experience in this type of genre to use. ! But why is important to all of us?
  • 6. Schedule • Introduction to Arduino and Installing Software • Project 1 • Electronics Concepts • Project 2 • Arduino IDE in Depth • Project 3 • Break • Project 4 • Explaining More Code • Project 5, 6, & 7 • ProjectTime with more ArduSensors
  • 9. Arduino IDE The Arduino IDE (Integrated Development Environment) is where we develop our code, and upload the code to the Arduino Leonardo board. You can download the latest software here: ! Arduino 1.0.5: bit.ly/arduinoide
  • 10. Downloading Code ! bit.ly/deezmakercode ! Put the downloaded folder on your desktop
  • 11. Arduino Drivers Mac: Click Red ‘X’ ! ! Windows XP / 7 / 8: ! ! ! Windows XP / 7 Secondary Option: http://bit.ly/ arduino-windows
  • 15. Serial Port / COM Port
  • 16. Which COM/Serial Port? Mac: /dev/tty.usbmodemfd131 ! Interchangeable #: ! Windows: COM# Device Manager: ! Start>Control Panel>System & Security>Device Manager>Ports
  • 19. 19
  • 22. ArduSensors - ‘Mini Shields’
  • 23. Concepts of Electronics • Polarity • Power /Voltage and Ground • Analog and Digital • Inputs and Outputs • PWM • Arduino IDE Review • Analog Inputs
  • 24. Polarity Polarity is when there are two or more different sides (or leads) of a component that have different qualities that can not be reversed. ! Examples: batteries, LEDs, buttons
  • 25. Power / Voltage and Ground (GND) Use only 5V or 3.3V in your projects Power + - Circuit
  • 26. Analog and Digital • All Arduino signals are either Analog or Digital • All computers can only understand Digital • Digital Pins D0 - D13 on Arduino • Special pins that are ADC enabled (analog to digital converter) we can connect sensors to • Analog Pins A0 - A5 on Arduino
  • 27. I/O, or Input/Output Input is any signal entering an electrical system/Arduino. ! Output is any signal exiting an electrical system.
  • 28. Output Output is always Digital ! To Output a Digital signal (On or Off) use this code: ! digitalWrite (pinNumber, value); ! Where value is HIGH (on) or LOW (off), both in caps
  • 29. Output To ‘Fade’ an LED or to output a voltage in-between 0V and 5V, use PWM ! Use this code to output an ‘analog’ signal: analogWrite (pinNumber, value); Where value is a number 0 - 255. (0V to 5V) ! PWM is available on Arduino Leonardo digital pins 3, 5, 6, 9, 10, 11, and 13, and marked with a ‘~’.
  • 30. Output Output is always Digital, even when it’s P.W.M. ! For P.W.M. the Arduino pin turns on, then off very fast ! ! P.W.M. Signal @ 25% P.W.M. Signal @ 75% P.W.M. Signal rising
  • 32. Arduino IDE in Depth • Parts of the Sketch • setup() • loop() • Comments • Analog Input
  • 33. Parts of the Sketch
  • 35. ! ! void loop ( ) { } ! ! ! ! ! ! ! !
  • 37. Comments • Comments are ignored by the compiler/ verifier • Comments can be anywhere • Starts with a // for a one-line comment • Starts with a /* and ends with a */ for a multiple-line comment • Great ways to remind you what you did, teach other people what that code means
  • 38. Analog Input • To connect an analog Input to your Arduino, use Analog Pins #A0 - A5 ! • To get an analog reading, use the code: analogRead(pinNumber); ! • Analog Input varies from 0 to 1023 on an Arduino
  • 39. Circuit 3: Analog Reading
  • 41. Break
  • 42. Digital Sensors/Digital Input • Digital Input could be a switch or a button • To connect digital input to your Arduino use Digital Pins # D0 – D13 • Digital Input needs a pinMode command (in setup): pinMode(pinNumber, INPUT); Make sure to use caps for INPUT • To get a digital reading: digitalRead(pinNumber); • Digital Input values are only HIGH (On) or LOW (Off)
  • 43. Digital Sensors/Digital Input • Digital sensors are more straight forward than Analog ! • No matter what the sensor, there are only two settings: On and Off ! • Voltage signal for LOW (off) will be 0V, and HIGH (on) will be 5V
  • 44. Parts for Circuit 4: Arduino Leonardo Breadboard Pushbutton (2) LED (2) Resistor - 10K Ohm (2) Resistor - 330 Ohm (2) Jumper Wires
  • 47. `
  • 49. Operators The equals sign ! = is used to assign a value ! == is used to compare values ! && is “and” ! || is “or”
  • 50. Variables Basic variable types: ! Boolean (on or off) Integer (a number) Character (a letter) String (a phrase)
  • 51. Declaring Variables Boolean: boolean variableName; ! Integer: int variableName; ! Character: char variableName; String: stringName [ ];
  • 52. Assigning Variables Boolean: variableName = true; or variableName = false;
  • 53. Assigning Variables Boolean: variableName = true; or variableName = false; Integer: variableName = 32767; or variableName = -32768;
  • 54. Assigning Variables Boolean: variableName = true; or variableName = false; Integer: variableName = 32767; or variableName = -32768; Character: variableName = ‘A’; or stringName = “Deezmaker”;
  • 57. Setup
 void setup ( ) { 
 pinMode (13, OUTPUT); } ! ! ! Inputs & Outputs are declared in setup, this is done by using the pinMode function This particular example declares digital pin # 13 as an output, remember to use CAPS
  • 58. ! ! If Statements if ( this is true ) { do this; } ! ! ! !
  • 59. ! ! Basic Repetition ! for (int count = 0; count<10; count++) { //for action code goes here //this could be anything }
  • 60. Circuit 6: LED Bounce