This is just a small program to check what possible led effects could be done - ofcourse the knight rider is the coolest one :)

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 //This is just a small testing program what LED effects can be done (knight rider style :))
00003 
00004 DigitalOut myled1(LED1);
00005 DigitalOut myled2(LED2);
00006 DigitalOut myled3(LED3);
00007 DigitalOut myled4(LED4);
00008 
00009 int main() {
00010     while(1) {
00011         //This part will turn on the leds
00012         myled1 = 1;
00013         wait(0.1);
00014         myled2 = 1;
00015         wait(0.1);
00016         myled3 = 1;
00017         wait(0.1);
00018         myled4 = 1;
00019         wait(0.1);
00020         //This part will turn off the leds
00021         myled1 = 0;
00022         wait(0.1);
00023         myled2 = 0;
00024         wait(0.1);
00025         myled3 = 0;
00026         wait(0.1);
00027         myled4 = 0;
00028         wait(0.1);
00029     }
00030 }