Task 3.3.2

Committer:
noutram
Date:
Thu Jul 13 14:49:41 2017 +0000
Revision:
1:0013ca7ee3f2
Parent:
0:4473259e507f
updated for mbed-os 5.5

Who changed what in which revision?

UserRevisionLine numberNew contents of line
noutram 0:4473259e507f 1 #include "mbed.h"
noutram 0:4473259e507f 2
noutram 0:4473259e507f 3 BusOut binaryOutput(D5, D6, D7);
noutram 0:4473259e507f 4 //DigitalIn SW1(D4);
noutram 0:4473259e507f 5
noutram 0:4473259e507f 6 int main() {
noutram 0:4473259e507f 7
noutram 0:4473259e507f 8 unsigned int uiCount = 0;
noutram 0:4473259e507f 9
noutram 0:4473259e507f 10 while(1) {
noutram 0:4473259e507f 11
noutram 0:4473259e507f 12 do {
noutram 0:4473259e507f 13 //Write decimal to the output
noutram 0:4473259e507f 14 binaryOutput = uiCount;
noutram 0:4473259e507f 15
noutram 0:4473259e507f 16 //Increment the count
noutram 0:4473259e507f 17 uiCount = uiCount + 1;
noutram 0:4473259e507f 18 wait(1.0); //Delay for 1s
noutram 0:4473259e507f 19
noutram 0:4473259e507f 20 //Condition to repeat
noutram 0:4473259e507f 21 } while (uiCount < 8);
noutram 0:4473259e507f 22
noutram 0:4473259e507f 23 //Reset the count
noutram 0:4473259e507f 24 uiCount = 0;
noutram 0:4473259e507f 25
noutram 0:4473259e507f 26 } //end while(1)
noutram 0:4473259e507f 27 } //end main