Task 3.3.2 Solution

main.cpp

Committer:
noutram
Date:
2017-07-13
Revision:
1:0453bbe1940b
Parent:
0:7b9a83230461

File content as of revision 1:0453bbe1940b:

#include "mbed.h"

BusOut binaryOutput(D5, D6, D7);
//DigitalIn SW1(D4);

int main() {

    int iCount = 7;

    while(1) {
        
        do {
            //Write decimal to the output
            binaryOutput = iCount;
            
            //Increment the count
            iCount = iCount - 1;  
            wait(1.0);              //Delay for 1s

        //Condition to repeat
        } while (iCount >= 0);    
                            
        //Reset the count
        iCount = 7;
        
    } //end while(1)
} //end main