Search icon CANCEL
Subscription
0
Cart icon
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Arduino BLINK Blueprints

You're reading from  Arduino BLINK Blueprints

Product type Book
Published in May 2016
Publisher Packt
ISBN-13 9781785284182
Pages 134 pages
Edition 1st Edition
Languages
Author (1):
Utsav Shah Utsav Shah
Profile icon Utsav Shah

Controlling multiple LEDs


In the embedded world, controlling a single LED is "Hello World" code, which we learned in first chapter. Now, as we are familiar with the concepts of LED, we can start to control multiple LEDs with Arduino. Here, we will start by making a simple traffic light module.

Simple traffic light controller

As we all know, a traffic light is made up of three LEDs: red, yellow, and green. To make this project, we need red, green, and yellow LEDs, strip wires, and a few 255 Ω resistors.

In the previous chapter, in our "Hello World" program, we connected an LED directly with pin 13. Here, we will connect red, yellow, and green LEDs with pins 9, 10, and 11 respectively. In the case of pin 13, it has an in-built pull up resistor. Pull up resistors are used to limit the current supplied to an LED. We can't give current of more than a few mA to LEDs. But, with pin 13, current is itself limited in Arduino by the internal pull up resistor. If we want to connect to pins other than 13...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime}