Mesud Klisura

Dependencies:   mbed

main.cpp

Committer:
tim004
Date:
2014-03-13
Revision:
0:44bd33c6fc78

File content as of revision 0:44bd33c6fc78:

#include "mbed.h"

BusOut led(dp23,dp24,dp25,dp26,dp27,dp5,dp6,dp28);
DigitalOut enable(dp14);
DigitalIn taster1(dp1);
DigitalIn taster2(dp2);

int main() {
    
  enable = 0;
  led = 0;
  int stanje1=0, stanje2=0;
  int i = 0;
    
  while(1) {
    
    led = i;
    wait(0.2);
    while(taster1==1) 
    {
        if(stanje1==0)
        {
            i++;
            if(taster1==0) break;
            if(i==256) i=0;
            stanje1=1;
        }
        stanje1=1;
    }
    stanje1=0;
    
    
    while(taster2==1) 
    {
        if(stanje2==0) 
        {
            i--;
            if(taster2==0) break;
            
            if(i==-1) i=256;
            stanje2=1;
        }
        stanje2=1;         
    }
    stanje2=0;
    }
}