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.
main.cpp@3:7952403aaae6, 2020-10-06 (annotated)
- Committer:
- markschwarzer
- Date:
- Tue Oct 06 14:52:01 2020 +0000
- Revision:
- 3:7952403aaae6
- Parent:
- 2:1692cf4dda7f
final product
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
slicht_instructor | 0:5597320f2dba | 1 | #include "mbed.h" |
slicht_instructor | 0:5597320f2dba | 2 | |
slicht_instructor | 0:5597320f2dba | 3 | Timer timerLED2; //creat timer object |
markschwarzer | 2:1692cf4dda7f | 4 | Timer timerLED3; |
slicht_instructor | 0:5597320f2dba | 5 | DigitalOut LEDOut2(LED2); |
markschwarzer | 2:1692cf4dda7f | 6 | DigitalOut LEDOut3(LED3); |
slicht_instructor | 0:5597320f2dba | 7 | |
slicht_instructor | 0:5597320f2dba | 8 | int main() |
slicht_instructor | 0:5597320f2dba | 9 | { |
slicht_instructor | 0:5597320f2dba | 10 | timerLED2.start(); //start timer counting |
markschwarzer | 2:1692cf4dda7f | 11 | timerLED3.start(); |
markschwarzer | 2:1692cf4dda7f | 12 | |
slicht_instructor | 0:5597320f2dba | 13 | while(1) { |
slicht_instructor | 0:5597320f2dba | 14 | if (timerLED2.read_ms()>=200) { //check to see if time has been exceeded |
slicht_instructor | 0:5597320f2dba | 15 | LEDOut2 = !LEDOut2; |
slicht_instructor | 0:5597320f2dba | 16 | timerLED2.reset(); //reset the timer back to zero |
markschwarzer | 2:1692cf4dda7f | 17 | } |
markschwarzer | 2:1692cf4dda7f | 18 | if (timerLED3.read_ms()>=400) { |
markschwarzer | 2:1692cf4dda7f | 19 | LEDOut3= !LEDOut3; |
markschwarzer | 2:1692cf4dda7f | 20 | timerLED3.reset(); } |
markschwarzer | 2:1692cf4dda7f | 21 | }} |