Oppgave 5.2b
Dependencies: mbed
main.cpp@0:b705d77ebf7c, 2017-10-03 (annotated)
- Committer:
- Smashftw
- Date:
- Tue Oct 03 11:09:32 2017 +0000
- Revision:
- 0:b705d77ebf7c
Oppgave52b
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Smashftw | 0:b705d77ebf7c | 1 | #include "mbed.h" |
Smashftw | 0:b705d77ebf7c | 2 | |
Smashftw | 0:b705d77ebf7c | 3 | DigitalOut myled(LED1), led2(LED4); |
Smashftw | 0:b705d77ebf7c | 4 | void blink5(int Tp, int Ta, int antall, DigitalOut &rLed); |
Smashftw | 0:b705d77ebf7c | 5 | |
Smashftw | 0:b705d77ebf7c | 6 | |
Smashftw | 0:b705d77ebf7c | 7 | int main() |
Smashftw | 0:b705d77ebf7c | 8 | { |
Smashftw | 0:b705d77ebf7c | 9 | blink5(500,500,4, myled); |
Smashftw | 0:b705d77ebf7c | 10 | blink5(250,250,10,led2); |
Smashftw | 0:b705d77ebf7c | 11 | return 0; |
Smashftw | 0:b705d77ebf7c | 12 | } |
Smashftw | 0:b705d77ebf7c | 13 | void blink5(int Tp, int Ta, int antall, DigitalOut &rLed) |
Smashftw | 0:b705d77ebf7c | 14 | { |
Smashftw | 0:b705d77ebf7c | 15 | for (int i=0; i<antall; i++) { |
Smashftw | 0:b705d77ebf7c | 16 | rLed=1; |
Smashftw | 0:b705d77ebf7c | 17 | wait_ms(Tp); |
Smashftw | 0:b705d77ebf7c | 18 | rLed=0; |
Smashftw | 0:b705d77ebf7c | 19 | wait_ms(Ta); |
Smashftw | 0:b705d77ebf7c | 20 | } |
Smashftw | 0:b705d77ebf7c | 21 | |
Smashftw | 0:b705d77ebf7c | 22 | |
Smashftw | 0:b705d77ebf7c | 23 | } |