SlideShare uma empresa Scribd logo
1 de 15
Introduction to
Arduino/Genuino Uno
By: Yeo Kheng Meng (yeokm1@gmail.com)
https://github.com/SustainableLivingLab/intro-to-arduinoStartathon (20 Feb 2016) 1
Components/Software check
• Laptop loaded with Arduino IDE
• Whole Hackpack or at least
• Arduino Uno
• Breadboard
• USB cable
• LED
• Button
• 220 ohm resistor
• 10k ohm resistor
• At least a few jumper wires
Why the 2 names?
• Different branding
• Arduino (sold in USA)
• Genuino (sold everywhere else)
• Some disagreements between the founders
• Uno boards from both brands are otherwise identical
First some electronic basics
Digital Logic Levels
• Logic HIGH = True = ON = +5V / +3.3V
• Logic LOW = False = OFF = 0V
• +5V for Arduino Uno
• +3.3V may be used by other devices
Analog signal
• Analog signals are smooth and continuous
• Can be positive and/or negative or both
• Signals will be converted by analog-to-digital converter (ADC)
in Arduino before use
• Arduino’s resolution is 10bits: 210 = 1024
• Range: 0 – 5V >>>> 0 – 1024
𝑅𝑒𝑠𝑢𝑙𝑡 =
𝑆𝑜𝑢𝑟𝑐𝑒 𝑉𝑜𝑙𝑡𝑎𝑔𝑒
𝑀𝑎𝑥 𝐿𝑜𝑔𝑖𝑐 𝑉𝑜𝑙𝑡𝑎𝑔𝑒 (5𝑉)
∗ 1024
Breadboard
• Your main prototyping component
• Continuous lines indicate those holes are connected
together
• Horizontal usually for power
• Convention: Red for +, Black/Blue for -
• Vertical for your components
Now we come to the Arduino
• Programmable board
• Use program code to:
• Receive signal inputs from pins
• Control signal outputs of pins
Ex 1: Blink onboard LED
• Sanity check, verifies if working
• Arduino hardware
• Arduino IDE settings
• Arduino IDE settings
• Arduino board: Arduino/Gemuino Uno
• Port: Depends on your machine
• Click “Upload” button (2nd from left)
• Understand source code
• Onboard LED blinks at 1 second intervals
Exercise objectives:
1. Use an example
2. Understand Arduino
code format
3. Concept of pins
4. Output to pin
5. Upload code
Create new Arduino file
1. Create folder on desktop
2. File -> New
3. Name program filename same as folder name
• Example: myblinker.ino
Ex 2: Blink external LED
• 220ohm resistor is to prevent too much
current from flowing -> Damage LED
• Arduino IDE instructions
1. Copy-paste Blink example to your
new file
2. Change Pin number 13 > 12
Exercise objectives:
1. Basic wiring up of breadboard
2. Creating your own Arduino sketch
Ex 3: Button adjusts LED state
• We will now try to toggle the LED
whenever button is pressed
• 10k ohm pull-down resistor
• Ensures button pin is LOW when button is
not pressed -> Not floating
• Prevents short circuit when button is
pressed
• Execute the code in Ex3
• Does the LED toggle as expected?
• Why?
Exercise objectives:
1. Retrieving input
2. Prevent floating pin
3. If-else branching
Ex 4: Debouncing
• Now lets try some code to solve this problem
Exercise objectives:
1. Long datatype
2. Debouncing
3. millis() function
4. Use of &&
• Debouncing:
• Accept only one input within
certain time period
Ex 5: Blink LED 3x on button press
• Blink LED 3x with blink separation of 100ms
Exercise objectives:
1. For - loop
Ex 6: Serial Port Debugging
• Useful debugging tool
• Let’s print out something when button is pressed
• Print the steps.
• Good practice to print “Arduino Ready” at end of setup()
• Tools -> Serial Monitor
• Ensure baud rate eg. 9600 match what you place in code
Exercise objectives:
1. Print Data over Serial

Mais conteúdo relacionado

Mais procurados

Introduction to arduino ppt main
Introduction to  arduino ppt mainIntroduction to  arduino ppt main
Introduction to arduino ppt main
eddy royappa
 

Mais procurados (20)

Introduction to Arduino Hardware and Programming
Introduction to Arduino Hardware and ProgrammingIntroduction to Arduino Hardware and Programming
Introduction to Arduino Hardware and Programming
 
Arduino Workshop Day 1 - Basic Arduino
Arduino Workshop Day 1 - Basic ArduinoArduino Workshop Day 1 - Basic Arduino
Arduino Workshop Day 1 - Basic Arduino
 
Arduino Workshop Day 2 - Advance Arduino & DIY
Arduino Workshop Day 2 - Advance Arduino & DIYArduino Workshop Day 2 - Advance Arduino & DIY
Arduino Workshop Day 2 - Advance Arduino & DIY
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
 
Introduction to Arduino Programming
Introduction to Arduino ProgrammingIntroduction to Arduino Programming
Introduction to Arduino Programming
 
Arduino for beginners- Introduction to Arduino (presentation) - codewithgauri
Arduino for beginners- Introduction to Arduino (presentation) - codewithgauriArduino for beginners- Introduction to Arduino (presentation) - codewithgauri
Arduino for beginners- Introduction to Arduino (presentation) - codewithgauri
 
Intro to Arduino
Intro to ArduinoIntro to Arduino
Intro to Arduino
 
Arduino Microcontroller
Arduino MicrocontrollerArduino Microcontroller
Arduino Microcontroller
 
Arduino Introduction (Blinking LED) Presentation (workshop #5)
Arduino  Introduction (Blinking LED)  Presentation (workshop #5)Arduino  Introduction (Blinking LED)  Presentation (workshop #5)
Arduino Introduction (Blinking LED) Presentation (workshop #5)
 
Arduino
ArduinoArduino
Arduino
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
 
Arduino presentation
Arduino presentationArduino presentation
Arduino presentation
 
Introduction to arduino ppt main
Introduction to  arduino ppt mainIntroduction to  arduino ppt main
Introduction to arduino ppt main
 
Arduino presentation by_warishusain
Arduino presentation by_warishusainArduino presentation by_warishusain
Arduino presentation by_warishusain
 
Arduino lcd display
Arduino lcd displayArduino lcd display
Arduino lcd display
 
Arduino
ArduinoArduino
Arduino
 
Arduino Family
Arduino FamilyArduino Family
Arduino Family
 
What is Arduino ?
What is Arduino ?What is Arduino ?
What is Arduino ?
 
Smart Door locking system using arduino
Smart Door locking system using arduinoSmart Door locking system using arduino
Smart Door locking system using arduino
 
Embedded system design using arduino
Embedded system design using arduinoEmbedded system design using arduino
Embedded system design using arduino
 

Destaque

Temperature Sensor with LED matrix Display BY ►iRFAN QADOOS◄ 9
Temperature Sensor with LED matrix Display BY ►iRFAN QADOOS◄ 9Temperature Sensor with LED matrix Display BY ►iRFAN QADOOS◄ 9
Temperature Sensor with LED matrix Display BY ►iRFAN QADOOS◄ 9
Irfan Qadoos
 
Moving message display
Moving message displayMoving message display
Moving message display
viraj1989
 
Rfid Presentation Slides
Rfid Presentation SlidesRfid Presentation Slides
Rfid Presentation Slides
guestbed1dd
 
Rfid ppt 8th sem
Rfid ppt 8th semRfid ppt 8th sem
Rfid ppt 8th sem
Amit Ranjan
 
Arduino Full Tutorial
Arduino Full TutorialArduino Full Tutorial
Arduino Full Tutorial
Akshay Sharma
 
Introduction to arduino
Introduction to arduinoIntroduction to arduino
Introduction to arduino
Ahmed Sakr
 

Destaque (20)

Arduino Model's
Arduino Model'sArduino Model's
Arduino Model's
 
Arduino Workshop
Arduino WorkshopArduino Workshop
Arduino Workshop
 
Catalogo unitronics 2012_intrave
Catalogo unitronics 2012_intraveCatalogo unitronics 2012_intrave
Catalogo unitronics 2012_intrave
 
8x8 dot matrix(project)
8x8 dot matrix(project)8x8 dot matrix(project)
8x8 dot matrix(project)
 
2015-10-21 - Arduino workshop
2015-10-21 - Arduino workshop2015-10-21 - Arduino workshop
2015-10-21 - Arduino workshop
 
Arduino uno-schematic
Arduino uno-schematicArduino uno-schematic
Arduino uno-schematic
 
Automatic Lamp using Arduino UNO, LDR and RTC DS1307
Automatic Lamp using Arduino UNO, LDR and RTC DS1307Automatic Lamp using Arduino UNO, LDR and RTC DS1307
Automatic Lamp using Arduino UNO, LDR and RTC DS1307
 
Temperature Sensor with LED matrix Display BY ►iRFAN QADOOS◄ 9
Temperature Sensor with LED matrix Display BY ►iRFAN QADOOS◄ 9Temperature Sensor with LED matrix Display BY ►iRFAN QADOOS◄ 9
Temperature Sensor with LED matrix Display BY ►iRFAN QADOOS◄ 9
 
5x7 matrix led display
5x7 matrix led display 5x7 matrix led display
5x7 matrix led display
 
Temperature sensor with a led matrix display (arduino controlled)
Temperature sensor with a led matrix display (arduino controlled)Temperature sensor with a led matrix display (arduino controlled)
Temperature sensor with a led matrix display (arduino controlled)
 
Arduino technical session 1
Arduino technical session 1Arduino technical session 1
Arduino technical session 1
 
Moving message display
Moving message displayMoving message display
Moving message display
 
Rfid Presentation Slides
Rfid Presentation SlidesRfid Presentation Slides
Rfid Presentation Slides
 
Role of easy vr in Arduino Speech Processing
Role of easy vr in Arduino Speech ProcessingRole of easy vr in Arduino Speech Processing
Role of easy vr in Arduino Speech Processing
 
Arduino uno
Arduino unoArduino uno
Arduino uno
 
Rfid ppt 8th sem
Rfid ppt 8th semRfid ppt 8th sem
Rfid ppt 8th sem
 
Arduino Lecture 1 - Introducing the Arduino
Arduino Lecture 1 - Introducing the ArduinoArduino Lecture 1 - Introducing the Arduino
Arduino Lecture 1 - Introducing the Arduino
 
Arduino Full Tutorial
Arduino Full TutorialArduino Full Tutorial
Arduino Full Tutorial
 
Introduction to arduino
Introduction to arduinoIntroduction to arduino
Introduction to arduino
 
Rfid ppt
Rfid pptRfid ppt
Rfid ppt
 

Semelhante a Introduction to Arduino

aurduino-200107075953.pdf
aurduino-200107075953.pdfaurduino-200107075953.pdf
aurduino-200107075953.pdf
HebaEng
 
Robotics Session day 1
Robotics Session day 1Robotics Session day 1
Robotics Session day 1
Afzal Ahmad
 

Semelhante a Introduction to Arduino (20)

Arduino spooky projects_class1
Arduino spooky projects_class1Arduino spooky projects_class1
Arduino spooky projects_class1
 
arduino
 arduino arduino
arduino
 
Lab2ppt
Lab2pptLab2ppt
Lab2ppt
 
aurduino-200107075953.pdf
aurduino-200107075953.pdfaurduino-200107075953.pdf
aurduino-200107075953.pdf
 
Arduino: On-board components description, IDE and Programming
Arduino: On-board components description, IDE and Programming Arduino: On-board components description, IDE and Programming
Arduino: On-board components description, IDE and Programming
 
Intro to Arduino Revision #2
Intro to Arduino Revision #2Intro to Arduino Revision #2
Intro to Arduino Revision #2
 
Aurdidino1 anurag preetirajesh-sgsits
Aurdidino1  anurag preetirajesh-sgsitsAurdidino1  anurag preetirajesh-sgsits
Aurdidino1 anurag preetirajesh-sgsits
 
IOT WORKSHEET 1.4.pdf
IOT WORKSHEET 1.4.pdfIOT WORKSHEET 1.4.pdf
IOT WORKSHEET 1.4.pdf
 
Introduction to arduino
Introduction to arduinoIntroduction to arduino
Introduction to arduino
 
ArduinoPart1.ppt
ArduinoPart1.pptArduinoPart1.ppt
ArduinoPart1.ppt
 
ArduinoPart1.ppt
ArduinoPart1.pptArduinoPart1.ppt
ArduinoPart1.ppt
 
ArduinoPart1.ppt
ArduinoPart1.pptArduinoPart1.ppt
ArduinoPart1.ppt
 
Arduino day
Arduino dayArduino day
Arduino day
 
Robotics Session day 1
Robotics Session day 1Robotics Session day 1
Robotics Session day 1
 
#startathon2.0 - Arduino
#startathon2.0 - Arduino#startathon2.0 - Arduino
#startathon2.0 - Arduino
 
Indroduction arduino
Indroduction arduinoIndroduction arduino
Indroduction arduino
 
Indroduction the arduino
Indroduction the arduinoIndroduction the arduino
Indroduction the arduino
 
Electronics Arduino Processors
Electronics Arduino ProcessorsElectronics Arduino Processors
Electronics Arduino Processors
 
computer system Architecture (Food detector)
computer system Architecture (Food detector)computer system Architecture (Food detector)
computer system Architecture (Food detector)
 
295889096 music-reactive-multicolor-led-lights
295889096 music-reactive-multicolor-led-lights295889096 music-reactive-multicolor-led-lights
295889096 music-reactive-multicolor-led-lights
 

Mais de yeokm1

Mais de yeokm1 (20)

I became a Private Pilot and this is my story
I became a Private Pilot and this is my storyI became a Private Pilot and this is my story
I became a Private Pilot and this is my story
 
What's inside a Cessna 172 and flying a light plane
What's inside a Cessna 172 and flying a light planeWhat's inside a Cessna 172 and flying a light plane
What's inside a Cessna 172 and flying a light plane
 
Speaking at Tech meetups/conferences for Junior Devs
Speaking at Tech meetups/conferences for Junior DevsSpeaking at Tech meetups/conferences for Junior Devs
Speaking at Tech meetups/conferences for Junior Devs
 
Reflections on Trusting Trust for Go
Reflections on Trusting Trust for GoReflections on Trusting Trust for Go
Reflections on Trusting Trust for Go
 
Meltdown and Spectre
Meltdown and SpectreMeltdown and Spectre
Meltdown and Spectre
 
Gentoo on a 486
Gentoo on a 486Gentoo on a 486
Gentoo on a 486
 
BLE Localiser (Full) for iOS Dev Scout
BLE Localiser (Full) for iOS Dev ScoutBLE Localiser (Full) for iOS Dev Scout
BLE Localiser (Full) for iOS Dev Scout
 
BLE Localiser for iOS Conf SG 2017
BLE Localiser for iOS Conf SG 2017BLE Localiser for iOS Conf SG 2017
BLE Localiser for iOS Conf SG 2017
 
Repair Kopitiam Specialty Tools (Part 2): Short Circuit Limiter
 Repair Kopitiam Specialty Tools (Part 2): Short Circuit Limiter Repair Kopitiam Specialty Tools (Part 2): Short Circuit Limiter
Repair Kopitiam Specialty Tools (Part 2): Short Circuit Limiter
 
PCB Business Card (Singapore Power)
PCB Business Card (Singapore Power)PCB Business Card (Singapore Power)
PCB Business Card (Singapore Power)
 
SP Auto Door Unlocker
SP Auto Door UnlockerSP Auto Door Unlocker
SP Auto Door Unlocker
 
SP IoT Doorbell
SP IoT DoorbellSP IoT Doorbell
SP IoT Doorbell
 
Distance Machine Locker
Distance Machine LockerDistance Machine Locker
Distance Machine Locker
 
A Science Project: Building a sound card based on the Covox Speech Thing
A Science Project: Building a sound card based on the Covox Speech ThingA Science Project: Building a sound card based on the Covox Speech Thing
A Science Project: Building a sound card based on the Covox Speech Thing
 
A Science Project: Swift Serial Chat
A Science Project: Swift Serial ChatA Science Project: Swift Serial Chat
A Science Project: Swift Serial Chat
 
The slide rule
The slide ruleThe slide rule
The slide rule
 
Windows 3.1 (WFW) on vintage and modern hardware
Windows 3.1 (WFW) on vintage and modern hardwareWindows 3.1 (WFW) on vintage and modern hardware
Windows 3.1 (WFW) on vintage and modern hardware
 
Repair Kopitiam Circuit Breaker Training
Repair Kopitiam Circuit Breaker TrainingRepair Kopitiam Circuit Breaker Training
Repair Kopitiam Circuit Breaker Training
 
A2: Analog Malicious Hardware
A2: Analog Malicious HardwareA2: Analog Malicious Hardware
A2: Analog Malicious Hardware
 
Getting Started with Raspberry Pi
Getting Started with Raspberry PiGetting Started with Raspberry Pi
Getting Started with Raspberry Pi
 

Último

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Último (20)

Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 

Introduction to Arduino

  • 1. Introduction to Arduino/Genuino Uno By: Yeo Kheng Meng (yeokm1@gmail.com) https://github.com/SustainableLivingLab/intro-to-arduinoStartathon (20 Feb 2016) 1
  • 2. Components/Software check • Laptop loaded with Arduino IDE • Whole Hackpack or at least • Arduino Uno • Breadboard • USB cable • LED • Button • 220 ohm resistor • 10k ohm resistor • At least a few jumper wires
  • 3. Why the 2 names? • Different branding • Arduino (sold in USA) • Genuino (sold everywhere else) • Some disagreements between the founders • Uno boards from both brands are otherwise identical
  • 5. Digital Logic Levels • Logic HIGH = True = ON = +5V / +3.3V • Logic LOW = False = OFF = 0V • +5V for Arduino Uno • +3.3V may be used by other devices
  • 6. Analog signal • Analog signals are smooth and continuous • Can be positive and/or negative or both • Signals will be converted by analog-to-digital converter (ADC) in Arduino before use • Arduino’s resolution is 10bits: 210 = 1024 • Range: 0 – 5V >>>> 0 – 1024 𝑅𝑒𝑠𝑢𝑙𝑡 = 𝑆𝑜𝑢𝑟𝑐𝑒 𝑉𝑜𝑙𝑡𝑎𝑔𝑒 𝑀𝑎𝑥 𝐿𝑜𝑔𝑖𝑐 𝑉𝑜𝑙𝑡𝑎𝑔𝑒 (5𝑉) ∗ 1024
  • 7. Breadboard • Your main prototyping component • Continuous lines indicate those holes are connected together • Horizontal usually for power • Convention: Red for +, Black/Blue for - • Vertical for your components
  • 8. Now we come to the Arduino • Programmable board • Use program code to: • Receive signal inputs from pins • Control signal outputs of pins
  • 9. Ex 1: Blink onboard LED • Sanity check, verifies if working • Arduino hardware • Arduino IDE settings • Arduino IDE settings • Arduino board: Arduino/Gemuino Uno • Port: Depends on your machine • Click “Upload” button (2nd from left) • Understand source code • Onboard LED blinks at 1 second intervals Exercise objectives: 1. Use an example 2. Understand Arduino code format 3. Concept of pins 4. Output to pin 5. Upload code
  • 10. Create new Arduino file 1. Create folder on desktop 2. File -> New 3. Name program filename same as folder name • Example: myblinker.ino
  • 11. Ex 2: Blink external LED • 220ohm resistor is to prevent too much current from flowing -> Damage LED • Arduino IDE instructions 1. Copy-paste Blink example to your new file 2. Change Pin number 13 > 12 Exercise objectives: 1. Basic wiring up of breadboard 2. Creating your own Arduino sketch
  • 12. Ex 3: Button adjusts LED state • We will now try to toggle the LED whenever button is pressed • 10k ohm pull-down resistor • Ensures button pin is LOW when button is not pressed -> Not floating • Prevents short circuit when button is pressed • Execute the code in Ex3 • Does the LED toggle as expected? • Why? Exercise objectives: 1. Retrieving input 2. Prevent floating pin 3. If-else branching
  • 13. Ex 4: Debouncing • Now lets try some code to solve this problem Exercise objectives: 1. Long datatype 2. Debouncing 3. millis() function 4. Use of && • Debouncing: • Accept only one input within certain time period
  • 14. Ex 5: Blink LED 3x on button press • Blink LED 3x with blink separation of 100ms Exercise objectives: 1. For - loop
  • 15. Ex 6: Serial Port Debugging • Useful debugging tool • Let’s print out something when button is pressed • Print the steps. • Good practice to print “Arduino Ready” at end of setup() • Tools -> Serial Monitor • Ensure baud rate eg. 9600 match what you place in code Exercise objectives: 1. Print Data over Serial