*** ****
Dependencies: mbed
Diff: main.cpp
- Revision:
- 0:92e813cd7f42
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Fri Oct 09 15:12:00 2015 +0000 @@ -0,0 +1,17 @@ +#include "mbed.h" + +BusOut display(D11,D10,D9,D5,D4,D3,D2,D1); + +int main() +{ while(1) { // while loop + for(int i=0;i<4;i++) { // for loop + switch(i) { // switch + case 0: display = 0x3F; break; // viser '0' (0)011 1111 -> 3F + case 1: display = 0x06; break; // viser '1' (0)000 0110 -> 06 + case 2: display = 0x5B; break; // viser '2' (0)101 1011 -> 5B + case 3: display = 0x4F; break; // viser '3' (0)100 1111 -> 4F + } // end switch + wait(0.5); + } // end for loop + } // end while loop +} // end main \ No newline at end of file