Task 3.3.2 Solution

Dependencies:   mbed

main.cpp

Committer:
noutram
Date:
2015-09-24
Revision:
0:7b9a83230461

File content as of revision 0:7b9a83230461:

#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