Embedded IO Homework 1 binary up/down counter

Dependencies:   C12832_lcd mbed

main.cpp

Committer:
Cabal51
Date:
2013-10-18
Revision:
0:82a38170d1ba

File content as of revision 0:82a38170d1ba:

/*
Author: Brian Tilton

*/

#include "mbed.h"
#include "C12832_lcd.h"

BusOut Bits(LED1,LED2,LED3,LED4);
C12832_LCD lcd;

int binval = 0x00;
bool flipS = false;
int clrScrn = 0;
int main() {
    while(1){
        Bits = binval;
        lcd.cls();
        lcd.locate(0,0);
        lcd.printf("%X\r",binval);
        
        if(binval == 0x0f)
            flipS = true;
        if(flipS == false)
            binval ++;
        if(binval == 0x00){
            flipS = false;
            binval++;
        }
        if(flipS == true)
            binval--;
            
        wait(1);
    }
}