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@0:6d2ef64cd61d, 2022-09-06 (annotated)
- Committer:
- mus3
- Date:
- Tue Sep 06 05:00:07 2022 +0000
- Revision:
- 0:6d2ef64cd61d
lab1 part1 code
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| mus3 | 0:6d2ef64cd61d | 1 | #include "mbed.h" |
| mus3 | 0:6d2ef64cd61d | 2 | #include "PinDetect.h" |
| mus3 | 0:6d2ef64cd61d | 3 | |
| mus3 | 0:6d2ef64cd61d | 4 | DigitalOut red(p5); |
| mus3 | 0:6d2ef64cd61d | 5 | DigitalIn pblight(p8); |
| mus3 | 0:6d2ef64cd61d | 6 | |
| mus3 | 0:6d2ef64cd61d | 7 | int main() { |
| mus3 | 0:6d2ef64cd61d | 8 | pblight.mode(PullUp); |
| mus3 | 0:6d2ef64cd61d | 9 | wait(0.001); |
| mus3 | 0:6d2ef64cd61d | 10 | while(1) { |
| mus3 | 0:6d2ef64cd61d | 11 | red = !pblight; |
| mus3 | 0:6d2ef64cd61d | 12 | } |
| mus3 | 0:6d2ef64cd61d | 13 | } |