Dushyant Kumar
/
4-bitcounter
Binary Counter
Revision 0:2e74c6cefef0, committed 2019-02-23
- Comitter:
- dushyantkumarsingh83
- Date:
- Sat Feb 23 19:55:15 2019 +0000
- Commit message:
- Binary Counter
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 2e74c6cefef0 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sat Feb 23 19:55:15 2019 +0000 @@ -0,0 +1,15 @@ +#include "mbed.h" +//#include "BusOut.h" +BusOut myleds(LED1,LED2,LED3,LED4); //defining four leds on board as output bus + +int main() +{ + unsigned char i; // defining i as character variable + while(1) { + for(i=0; i<=15; i++) { // for loop to count from 0 - 15 having 4 - counter + //myleds=i; // assigning the counted value to leds on the board + myleds.write(i); // assigning the counted value to leds on the board using write function + wait(0.5); // delay to hold led for some time in on/off condition + } + } +}
diff -r 000000000000 -r 2e74c6cefef0 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Sat Feb 23 19:55:15 2019 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/a9913a65894f \ No newline at end of file