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@1:ae75c5bfd6c6, 2022-05-22 (annotated)
- Committer:
- hughbellinger
- Date:
- Sun May 22 18:20:40 2022 +0000
- Revision:
- 1:ae75c5bfd6c6
- Parent:
- 0:679afb0ef65b
intrpt;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
hughbellinger | 0:679afb0ef65b | 1 | #include "mbed.h" |
hughbellinger | 1:ae75c5bfd6c6 | 2 | InterruptIn button(p5); |
hughbellinger | 1:ae75c5bfd6c6 | 3 | DigitalOut led(LED1); |
hughbellinger | 1:ae75c5bfd6c6 | 4 | DigitalOut flash(LED2); |
hughbellinger | 1:ae75c5bfd6c6 | 5 | void flip(){ |
hughbellinger | 1:ae75c5bfd6c6 | 6 | led=1; |
hughbellinger | 1:ae75c5bfd6c6 | 7 | wait(0.2); |
hughbellinger | 1:ae75c5bfd6c6 | 8 | led=0; |
hughbellinger | 1:ae75c5bfd6c6 | 9 | wait(0.2); |
hughbellinger | 1:ae75c5bfd6c6 | 10 | } |
hughbellinger | 1:ae75c5bfd6c6 | 11 | |
hughbellinger | 0:679afb0ef65b | 12 | int main() { |
hughbellinger | 1:ae75c5bfd6c6 | 13 | button.rise(&flip); |
hughbellinger | 1:ae75c5bfd6c6 | 14 | while(1) { |
hughbellinger | 1:ae75c5bfd6c6 | 15 | flash = 1; |
hughbellinger | 1:ae75c5bfd6c6 | 16 | wait(0.2); |
hughbellinger | 1:ae75c5bfd6c6 | 17 | led = 0; |
hughbellinger | 1:ae75c5bfd6c6 | 18 | wait(0.2); |
hughbellinger | 1:ae75c5bfd6c6 | 19 | } |
hughbellinger | 0:679afb0ef65b | 20 | } |
hughbellinger | 1:ae75c5bfd6c6 | 21 |