DigitalOut & BusOut test with LED1~4

Dependencies:   mbed

Committer:
Bongjun
Date:
Fri Jun 27 00:19:35 2014 +0000
Revision:
0:0631d5c7c892
DigitalOut & BusOut test

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Bongjun 0:0631d5c7c892 1 #include "mbed.h"
Bongjun 0:0631d5c7c892 2
Bongjun 0:0631d5c7c892 3 DigitalOut led1(LED1); // Configure LED1 pin as output
Bongjun 0:0631d5c7c892 4 BusOut leds(LED2, LED3, LED4);
Bongjun 0:0631d5c7c892 5
Bongjun 0:0631d5c7c892 6 int main() {
Bongjun 0:0631d5c7c892 7 uint8_t count = 0;
Bongjun 0:0631d5c7c892 8 while(1) {
Bongjun 0:0631d5c7c892 9 if ((count % 10)==0) led1 = !led1; // every count is 10, led1 is blinking.
Bongjun 0:0631d5c7c892 10 leds = count++;
Bongjun 0:0631d5c7c892 11 wait(1);
Bongjun 0:0631d5c7c892 12 }
Bongjun 0:0631d5c7c892 13 }