Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
main.cpp@0:577d9598d207, 2017-09-26 (annotated)
- Committer:
- Smashftw
- Date:
- Tue Sep 26 11:07:19 2017 +0000
- Revision:
- 0:577d9598d207
oppgave51c
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Smashftw | 0:577d9598d207 | 1 | #include "mbed.h" |
Smashftw | 0:577d9598d207 | 2 | |
Smashftw | 0:577d9598d207 | 3 | DigitalOut myled(LED1); |
Smashftw | 0:577d9598d207 | 4 | int blink2; |
Smashftw | 0:577d9598d207 | 5 | int main() |
Smashftw | 0:577d9598d207 | 6 | { |
Smashftw | 0:577d9598d207 | 7 | int n = 30; |
Smashftw | 0:577d9598d207 | 8 | while(n>0) { |
Smashftw | 0:577d9598d207 | 9 | |
Smashftw | 0:577d9598d207 | 10 | blink2(0.133, 0.067); |
Smashftw | 0:577d9598d207 | 11 | n--; |
Smashftw | 0:577d9598d207 | 12 | }return 0; |
Smashftw | 0:577d9598d207 | 13 | } |
Smashftw | 0:577d9598d207 | 14 | |
Smashftw | 0:577d9598d207 | 15 | void blink2(float Tp, float Ta){ |
Smashftw | 0:577d9598d207 | 16 | myled=1; |
Smashftw | 0:577d9598d207 | 17 | wait(Tp); |
Smashftw | 0:577d9598d207 | 18 | myled=0; |
Smashftw | 0:577d9598d207 | 19 | wait(Ta); |
Smashftw | 0:577d9598d207 | 20 | } |