by Rob Toulson and Tim Wilmshurst from textbook "Fast and Effective Embedded Systems Design: Applying the ARM mbed"
Revision 0:0e32344cdb26, committed 2012-08-31
- Comitter:
- robt
- Date:
- Fri Aug 31 15:25:02 2012 +0000
- Commit message:
- by Rob Toulson and Tim Wilmshurst from textbook "Fast and Effective Embedded Systems Design: Applying the ARM mbed"
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
diff -r 000000000000 -r 0e32344cdb26 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Fri Aug 31 15:25:02 2012 +0000 @@ -0,0 +1,28 @@ +/*Program Example 3.5: Simple demonstration of 7-segment display. Display digits 0, 1, 2, 3 in turn. + */ +#include "mbed.h" +BusOut display(p5,p6,p7,p8,p9,p10,p11,p12); // segments a,b,c,d,e,f,g,dp + +int main() +{ + while(1) { + for(int i=0; i<4; i++) { + switch (i) { + case 0: + display = 0x3F; + break; //display 0 + case 1: + display = 0x06; + break; //display 1 + case 2: + display = 0x5B; + break; + case 3: + display = 0x4F; + break; + } //end of switch + wait(0.2); + } //end of for + } //end of while +} //end of main +
diff -r 000000000000 -r 0e32344cdb26 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Fri Aug 31 15:25:02 2012 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/cd19af002ccc \ No newline at end of file