![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Oving4_4
Dependencies: mbed
main.cpp@0:5071536b4cf6, 2017-09-19 (annotated)
- Committer:
- andreped
- Date:
- Tue Sep 19 12:08:40 2017 +0000
- Revision:
- 0:5071536b4cf6
- Child:
- 1:e3039b96e3e9
Oving4_4;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
andreped | 0:5071536b4cf6 | 1 | #include "mbed.h" |
andreped | 0:5071536b4cf6 | 2 | |
andreped | 0:5071536b4cf6 | 3 | DigitalOut Led1(LED1); |
andreped | 0:5071536b4cf6 | 4 | DigitalOut Led2(LED2); |
andreped | 0:5071536b4cf6 | 5 | DigitalOut Led3(LED3); |
andreped | 0:5071536b4cf6 | 6 | DigitalOut Led4(LED4); |
andreped | 0:5071536b4cf6 | 7 | Ticker tick1; |
andreped | 0:5071536b4cf6 | 8 | Ticker tick2; |
andreped | 0:5071536b4cf6 | 9 | Ticker tick3; |
andreped | 0:5071536b4cf6 | 10 | Ticker tick4; |
andreped | 0:5071536b4cf6 | 11 | |
andreped | 0:5071536b4cf6 | 12 | void x() |
andreped | 0:5071536b4cf6 | 13 | { |
andreped | 0:5071536b4cf6 | 14 | Led1 = 1; |
andreped | 0:5071536b4cf6 | 15 | tick1.detach(); |
andreped | 0:5071536b4cf6 | 16 | } |
andreped | 0:5071536b4cf6 | 17 | void y() |
andreped | 0:5071536b4cf6 | 18 | { |
andreped | 0:5071536b4cf6 | 19 | Led2 = 1; |
andreped | 0:5071536b4cf6 | 20 | tick2.detach(); |
andreped | 0:5071536b4cf6 | 21 | } |
andreped | 0:5071536b4cf6 | 22 | void z() |
andreped | 0:5071536b4cf6 | 23 | { |
andreped | 0:5071536b4cf6 | 24 | Led3 = 1; |
andreped | 0:5071536b4cf6 | 25 | tick3.detach(); |
andreped | 0:5071536b4cf6 | 26 | } |
andreped | 0:5071536b4cf6 | 27 | void e() |
andreped | 0:5071536b4cf6 | 28 | { |
andreped | 0:5071536b4cf6 | 29 | Led4 = 1; |
andreped | 0:5071536b4cf6 | 30 | tick4.detach(); |
andreped | 0:5071536b4cf6 | 31 | } |
andreped | 0:5071536b4cf6 | 32 | int main() |
andreped | 0:5071536b4cf6 | 33 | { |
andreped | 0:5071536b4cf6 | 34 | tick1.attach(&x,1); |
andreped | 0:5071536b4cf6 | 35 | tick2.attach(&y, 0.3); |
andreped | 0:5071536b4cf6 | 36 | tick3.attach(&z, 0.14); |
andreped | 0:5071536b4cf6 | 37 | tick4.attach(&e, 0.1); |
andreped | 0:5071536b4cf6 | 38 | while(1) { |
andreped | 0:5071536b4cf6 | 39 | |
andreped | 0:5071536b4cf6 | 40 | } |
andreped | 0:5071536b4cf6 | 41 | } |