lauflicht,rgb

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #define BUTTON1 p14
00002 #include "mbed.h"
00003 // Flash an LED while a DigitalIn is true
00004 
00005 DigitalIn enable(p14); 
00006 BusOut leds(LED1,LED2,LED3,LED4);
00007 BusOut rgb(p23,p24,p15);
00008 BusIn joy(p12,p13,p14,p15,p16);
00009 
00010 
00011 
00012  
00013 int main() {
00014     
00015     while(1) {
00016             
00017          if(leds==0)
00018          {
00019             leds=1;
00020             rgb=255;
00021         }
00022             else
00023             
00024          leds=leds<<1;   
00025          rgb=rgb+1;
00026         
00027        wait_ms(200);
00028     }
00029     }