Christian Lerche
/
LEDCount
Simple binary upcounter
Diff: main.cpp
- Revision:
- 0:d5c405727b8d
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Dec 03 09:59:13 2009 +0000 @@ -0,0 +1,13 @@ +// 4 bit binary counter, using onboard LEDs +#include "mbed.h" + +unsigned char i; // Make variable "i" a char (8bit) + +BusOut leds(LED4, LED3, LED2, LED1); // Create a BusOut variable "leds", with LED1-4 + +int main() { // Main structure + while(1) { // While-loop (Do forever) + leds = leds+1; // Every loop, add one to leds variable + wait(0.5); // Wait for .5 seconds + } // End of While-loop +} // End of Main structure \ No newline at end of file