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:386021451960, 2019-05-06 (annotated)
- Committer:
- nishayi
- Date:
- Mon May 06 23:32:15 2019 +0000
- Revision:
- 0:386021451960
Sample Code
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| nishayi | 0:386021451960 | 1 | #include "mbed.h" |
| nishayi | 0:386021451960 | 2 | |
| nishayi | 0:386021451960 | 3 | DigitalIn mybutton(PC_13); DigitalOut myled(PA_5); |
| nishayi | 0:386021451960 | 4 | |
| nishayi | 0:386021451960 | 5 | int main() |
| nishayi | 0:386021451960 | 6 | { |
| nishayi | 0:386021451960 | 7 | while(1) |
| nishayi | 0:386021451960 | 8 | { |
| nishayi | 0:386021451960 | 9 | if (mybutton == 0) // Button is pressed |
| nishayi | 0:386021451960 | 10 | myled = 1; |
| nishayi | 0:386021451960 | 11 | else // Button is NOT pressed |
| nishayi | 0:386021451960 | 12 | myled = 0; |
| nishayi | 0:386021451960 | 13 | } |
| nishayi | 0:386021451960 | 14 | } |