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@1:f7aaf003cd11, 2021-01-21 (annotated)
- Committer:
- ahoffman41
- Date:
- Thu Jan 21 17:04:34 2021 +0000
- Revision:
- 1:f7aaf003cd11
- Parent:
- 0:f1fe3296c466
- Child:
- 2:3ca6379931dd
test
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| glanier9 | 0:f1fe3296c466 | 1 | // 4180 Lab 1, Part 1 |
| glanier9 | 0:f1fe3296c466 | 2 | // Gregory Lanier |
| glanier9 | 0:f1fe3296c466 | 3 | |
| glanier9 | 0:f1fe3296c466 | 4 | #include "mbed.h" |
| glanier9 | 0:f1fe3296c466 | 5 | |
| glanier9 | 0:f1fe3296c466 | 6 | /* |
| glanier9 | 0:f1fe3296c466 | 7 | This program lights up an LED with a pushbutton input. |
| glanier9 | 0:f1fe3296c466 | 8 | */ |
| glanier9 | 0:f1fe3296c466 | 9 | |
| glanier9 | 0:f1fe3296c466 | 10 | DigitalIn button(p8); // Turn on LED with button p8 |
| glanier9 | 0:f1fe3296c466 | 11 | DigitalOut redLED(p21); // Light up LED with pin 21 |
| glanier9 | 0:f1fe3296c466 | 12 | |
| glanier9 | 0:f1fe3296c466 | 13 | int main() |
| glanier9 | 0:f1fe3296c466 | 14 | { |
| glanier9 | 0:f1fe3296c466 | 15 | button.mode(PullUp); |
| glanier9 | 0:f1fe3296c466 | 16 | while(1) |
| glanier9 | 0:f1fe3296c466 | 17 | { |
| glanier9 | 0:f1fe3296c466 | 18 | redLED = !button; |
| glanier9 | 0:f1fe3296c466 | 19 | } |
| glanier9 | 0:f1fe3296c466 | 20 | } |
| ahoffman41 | 1:f7aaf003cd11 | 21 | |
| ahoffman41 | 1:f7aaf003cd11 | 22 | |
| ahoffman41 | 1:f7aaf003cd11 | 23 | // this is a test |