tim003 tim003
/
LV2_Grupa1_Tim003_Zadatak2
Irma Jakić Tarik Demirović
main.cpp
- Committer:
- tim003
- Date:
- 2014-03-10
- Revision:
- 0:d515d96c18e3
File content as of revision 0:d515d96c18e3:
#include "mbed.h" BusOut leds(dp23, dp24, dp25, dp26, dp27, dp5, dp6, dp28); DigitalOut enable(dp14); DigitalIn taster1(dp1); DigitalIn taster2(dp2); bool pressed1() { int j = 0; while(taster1) { j++; if(j > 1000) { return true; } } j = 0; return false; } bool pressed2() { int j = 0; while(taster2) { j++; if(j > 1000) { return true; } } j = 0; return false; } int main() { enable = 0; leds = 0; int i = 0; while(1) { if(pressed1()) { if(i == 256) { i = 0; } i++; leds = i; while(taster1){} } if(pressed2()) { if(i == 0) { i = 257; } i--; leds = i; while(taster2) {} } } }