Arduino tutorial: 8 LED simple flasher using lookup table

This program is a development of previous post. This uses the table as a data storage pattern of the LED and the constant of the delay.



To save the patterns and the delay led to use of variables and dataDelay dataFlasher as a array of byte and integer. This table will be placed in the microcontroller program code permanently.

DataFlasher variable is a data sequence of LED patterns, written in binary format for ease verification of the pattern. While the variable  of dataDelay is a data constants of each led patterns as passing parameter for the function of delay(). As dummy load, on the end of data of dataDelay variable is set as null. This is for mark that no data after it.

Inside the function of loop() get any data for led pattern, which is in dataFlasher variables to be sent to each bit of LED (D2 to D9). On line 49 is masking of lsb of current dataFlasher and sent to led with d variabel as channel of digital port. Next on line 50, variable of i to be right shifted for the next bit.

The next data is taken, until dataDelay = 0.  

YouTube Preview Image

Source can be downloaded here

Last updated by at .

Avatar of Bambang Siswoyo

About Bambang Siswoyo

I am a college lecturer since 1988 at UB (University of Brawijaya) in the electronics department. My experience: Applications of Microprocessor system, Applications of Control System, Applications of Field Programmable Gate Array, Computer Programming in computer instrumentations. My hobby: Music especially playing the saxophone, hiking and exploring the countryside.
This entry was posted in Arduino, Arduino, Tutorial and tagged , . Bookmark the permalink.

4 Responses to Arduino tutorial: 8 LED simple flasher using lookup table

  1. rey bern says:

    i’m so interested to know about your ledwidget project, controlling 8 LED in arduino using VB6.0 but can i ask for the source code of this project in VB6, so i can teach it to my students. i’ve done with 1 LED but i cannot figure out controlling more than 2 to 8 LEDs.
    please help.
    Thanks alot!

  2. syahri says:

    mas bisa minta pencerahannya kalo misalnya kita pengen ngebaca 3 sensor kelembaban sekaligus dengan arduino kodenya seperti apa yah? kebetulan saya udah nyoba dan gagal,,,
    bisa dikirim ke email saya di :

Leave a Reply

Your email address will not be published. Required fields are marked *



You may use these HTML tags and attributes: <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>