***
Dependencies: mbed
main.cpp@0:c66b07aa1109, 2015-10-09 (annotated)
- Committer:
- knut_johan
- Date:
- Fri Oct 09 15:09:26 2015 +0000
- Revision:
- 0:c66b07aa1109
l?reboka
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
knut_johan | 0:c66b07aa1109 | 1 | #include "mbed.h" |
knut_johan | 0:c66b07aa1109 | 2 | DigitalOut myled(LED1); |
knut_johan | 0:c66b07aa1109 | 3 | DigitalOut yourled(LED4); |
knut_johan | 0:c66b07aa1109 | 4 | |
knut_johan | 0:c66b07aa1109 | 5 | int main() |
knut_johan | 0:c66b07aa1109 | 6 | { |
knut_johan | 0:c66b07aa1109 | 7 | char i=0; |
knut_johan | 0:c66b07aa1109 | 8 | while(1) { //starter evig loop |
knut_johan | 0:c66b07aa1109 | 9 | while(i<10) { //starter første loop |
knut_johan | 0:c66b07aa1109 | 10 | myled=1; |
knut_johan | 0:c66b07aa1109 | 11 | wait(0.2); |
knut_johan | 0:c66b07aa1109 | 12 | myled=0; |
knut_johan | 0:c66b07aa1109 | 13 | wait(0.2); |
knut_johan | 0:c66b07aa1109 | 14 | i++; } //slutter første loop |
knut_johan | 0:c66b07aa1109 | 15 | |
knut_johan | 0:c66b07aa1109 | 16 | while(i>0) { //starter andre loop |
knut_johan | 0:c66b07aa1109 | 17 | yourled=1; |
knut_johan | 0:c66b07aa1109 | 18 | wait(0.2); |
knut_johan | 0:c66b07aa1109 | 19 | yourled=0; |
knut_johan | 0:c66b07aa1109 | 20 | wait(0.2); |
knut_johan | 0:c66b07aa1109 | 21 | i--; } //slutte andre loop |
knut_johan | 0:c66b07aa1109 | 22 | } //slutter evig loop |
knut_johan | 0:c66b07aa1109 | 23 | } // end main |