Dependencies:   LM75B mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 
00003 
00004 BusOut Led(P1_8,P1_9,P1_10,P1_11,P1_0,P1_1,P1_3,P1_4,P1_6,P1_7,P1_12,P1_13); 
00005 int main() 
00006 { 
00007     while(1) 
00008     { 
00009     Led = 0;
00010     wait_ms(100);
00011    
00012     for (char j = 0b0000;j<0b1100;j++)
00013     {   
00014         Led = 0b1<<j | Led ;
00015         
00016         wait_ms(80);
00017     }
00018     for (char j = 0b0;j<0b1100;j++)
00019     {
00020         Led =  Led & 0b1111111111111 >> j ;
00021         wait_ms(80);
00022     }
00023      for (char j = 0b0;j<0b1010;j++)
00024     {           Led = Led & 0b0;
00025                 wait(0.07);
00026                 Led = 0b111111111111;
00027                 wait(0.25);
00028                 
00029     }}
00030     }