Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Arduino BLINK Blueprints

You're reading from   Arduino BLINK Blueprints Get the most out of your Arduino to develop exciting and creative LED-based projects

Arrow left icon
Product type Paperback
Published in May 2016
Publisher Packt
ISBN-13 9781785284182
Length 134 pages
Edition 1st Edition
Tools
Arrow right icon
Authors (2):
Arrow left icon
Utsav Shah Utsav Shah
Author Profile Icon Utsav Shah
Utsav Shah
Samarth Shah Samarth Shah
Author Profile Icon Samarth Shah
Samarth Shah
Arrow right icon
View More author details
Toc

Synchronizing an LED array with a motor


In the previous sections of this chapter, we learned about controlling an LED array and DC motor using Arduino:

Once you have connected the circuit as shown in the preceding image, upload the following code to Arduino. In the following code, we are writing the "Hello world" of persistence of vision:

int LEDPins[] = {2, 3, 4, 5, 6, 7, 8, 9};
int noOfLEDs = 8;

//data corresponding to the each alphabet and a few characters to be displayed
byte H[] = {B11111111, B11111111, B00011000, B00011000, B00011000, B00011000, B11111111, B11111111};
byte E[] = {B00000000, B11111111, B11011011, B11011011, B11011011, B11011011, B11000011, B11000011};
byte L[] = {B00000000, B11111111, B11111111, B00000011, B00000011, B00000011, B00000011, B00000011};
byte O[] = {B00000000, B11111111, B11111111, B11000011, B11000011, B11000011, B11111111, B11111111};
byte fullstop[] = {B00000000, B00000000, B00000000, B00000011, B00000011, B00000000, B00000000, B00000000};
byte comma...
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 €18.99/month. Cancel anytime