tim008 tim008
/
lab2_grupa2_tim8
Beganovic Benjamin Mustafic Faruk
Revision 0:34edea07dc58, committed 2014-03-10
- Comitter:
- tim008
- Date:
- Mon Mar 10 09:45:17 2014 +0000
- Commit message:
- lab2_grupa2_tim8
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon Mar 10 09:45:17 2014 +0000 @@ -0,0 +1,28 @@ +#include <cmath> + +#include "mbed.h" + +#define WAIT_TIME 1 +#define MAX_COUNT 255 + + +int main() { + BusOut my_ledice(dp23, dp24, dp25, dp26, + dp27, dp5, dp6, dp28); + my_ledice = 0; + + DigitalOut enable_signal(dp14); + enable_signal = 0; + + while(true) { + if(DigitalIn(dp1)) + my_ledice = + (my_ledice == 0) ? MAX_COUNT : ((my_ledice - 1) % MAX_COUNT); + else + my_ledice = ((my_ledice + 1) % MAX_COUNT); + + wait(WAIT_TIME); + } + + return 0; // redundant +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Mon Mar 10 09:45:17 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/8e73be2a2ac1 \ No newline at end of file