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@0:7b3cd0e11b6e, 2015-03-13 (annotated)
- Committer:
- dousape2
- Date:
- Fri Mar 13 03:34:07 2015 +0000
- Revision:
- 0:7b3cd0e11b6e
- Child:
- 1:8fc51018d66d
simply
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| dousape2 | 0:7b3cd0e11b6e | 1 | #include "mbed.h" |
| dousape2 | 0:7b3cd0e11b6e | 2 | |
| dousape2 | 0:7b3cd0e11b6e | 3 | PortIn myIOs(PortC, 0xE000); // PC_15 + PC_14 + PC_13 |
| dousape2 | 0:7b3cd0e11b6e | 4 | |
| dousape2 | 0:7b3cd0e11b6e | 5 | DigitalOut myled(LED1); |
| dousape2 | 0:7b3cd0e11b6e | 6 | |
| dousape2 | 0:7b3cd0e11b6e | 7 | int main() { |
| dousape2 | 0:7b3cd0e11b6e | 8 | myIOs.mode(PullNone); // PullDown PullUp PullNone OpenDrain |
| dousape2 | 0:7b3cd0e11b6e | 9 | while(1) { |
| dousape2 | 0:7b3cd0e11b6e | 10 | if (myIOs.read() != 0xE000 && myIOs != 0xE000) { // Any of the 3 IOs is low, two posibility to read value |
| dousape2 | 0:7b3cd0e11b6e | 11 | myled = !myled; // Toggle LED state |
| dousape2 | 0:7b3cd0e11b6e | 12 | wait(0.2); |
| dousape2 | 0:7b3cd0e11b6e | 13 | } |
| dousape2 | 0:7b3cd0e11b6e | 14 | } |
| dousape2 | 0:7b3cd0e11b6e | 15 | } |
| dousape2 | 0:7b3cd0e11b6e | 16 |