In this video, Zahraa demonstrates how to use Arduino to control three separate digital interfaces by writing a program using the Arduino software IDE to turn on each LED separately for a certain time, and using and monitoring it using the serial monitor.
- [Instructor] Alright, so now for the coding.…The very first thing that we need to do…is to initialize the variables.…So I'll go ahead and add it outside the void setup function.…So I'll initialize integer GreenLed…that's connected to pin 10.…And I'll do the same for the other LEDs.…Okay, so the second thing is that I need to set…each LED to be as an output.…So we do so by going to the void setup function.…
And then I use pinMode and then I write down…the same name that I initialized for the variable,…which is GreenLed.…Make sure that you give the same name.…And then as output.…So, I'll do the same thing for the other two LEDs.…So I'll copy the same function.…And in order to make sure that I give the right name…I'll just copy the name from the top.…So this is for the yellow.…
And then finally for the red.…So one of the things that we usually do…in such examples is that we want to make sure…that the LEDs are off to start with.…So to do, we initialize the digital write…inside the void setup.…So digitalWrite for the green LED to be off,…
- What's an Arduino?
- Creating an Arduino program
- Using the setup() and loop() functions
- Using the pinMode() and digitalWrite() commands
- Creating your first sketch
- Writing code to turn LEDs on and off
- Wiring a pushbutton to Arduino
- Activating an LED with a pushbutton
Skill Level Beginner
Learning Arduino: Pulse Width Modulationwith Rae Hoyt1h 16m Intermediate
Learning Arduino: Interfacing with Hardwarewith Zahraa Khalil1h 40m Intermediate
1. Introduction to Arduino
2. Creating an Arduino Program
3. Interface with Ouptut: LED
4. Interface with Input: Pushbutton
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.