![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Lejla Agić Pajić Enil
Diff: main.cpp
- Revision:
- 0:87b90179fb7d
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon Mar 10 08:11:05 2014 +0000 @@ -0,0 +1,24 @@ +#include "mbed.h" + +BusOut l (dp23, dp24, dp25, dp26, dp27, dp5, dp6, dp28); +DigitalOut e (dp14); +DigitalIn t1 (dp1); +DigitalIn t2 (dp2); + +int main() { + e = 0; + int x = 0; + bool p = false; + l = x; + while(1) { + l = (x + 1) % 256; + wait (0.15); + if (!p) + { + p = true; + if (t1 == 1) x++; + else if (t2 == 1) x--; + } + if (t1 == 0 && t2 == 0) p = false; + } +}