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:8fc51018d66d, 2015-03-21 (annotated)
- Committer:
- dousape2
- Date:
- Sat Mar 21 16:07:43 2015 +0000
- Revision:
- 1:8fc51018d66d
- Parent:
- 0:7b3cd0e11b6e
- Child:
- 2:8af0223a6c51
chyb? vysv?tlit 0xE000
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| dousape2 | 1:8fc51018d66d | 1 | /********************************************************************************** |
| dousape2 | 1:8fc51018d66d | 2 | * @file main.cpp |
| dousape2 | 1:8fc51018d66d | 3 | * @author Name |
| dousape2 | 1:8fc51018d66d | 4 | * @version V0.1 |
| dousape2 | 1:8fc51018d66d | 5 | * @date 09-March-2015 |
| dousape2 | 1:8fc51018d66d | 6 | * @brief Does something. |
| dousape2 | 1:8fc51018d66d | 7 | * Even this! |
| dousape2 | 1:8fc51018d66d | 8 | ***********************************************************************************/ |
| dousape2 | 1:8fc51018d66d | 9 | |
| dousape2 | 1:8fc51018d66d | 10 | /* Includes ----------------------------------------------------------------------*/ |
| dousape2 | 0:7b3cd0e11b6e | 11 | #include "mbed.h" |
| dousape2 | 0:7b3cd0e11b6e | 12 | |
| dousape2 | 1:8fc51018d66d | 13 | //mbed - initialization of peripherals |
| dousape2 | 0:7b3cd0e11b6e | 14 | PortIn myIOs(PortC, 0xE000); // PC_15 + PC_14 + PC_13 |
| dousape2 | 0:7b3cd0e11b6e | 15 | DigitalOut myled(LED1); |
| dousape2 | 0:7b3cd0e11b6e | 16 | |
| dousape2 | 1:8fc51018d66d | 17 | /* Functions----------------------------------------------------------------------*/ |
| dousape2 | 1:8fc51018d66d | 18 | |
| dousape2 | 1:8fc51018d66d | 19 | |
| dousape2 | 1:8fc51018d66d | 20 | /*********************************************************************************** |
| dousape2 | 1:8fc51018d66d | 21 | * Function Name : main. |
| dousape2 | 1:8fc51018d66d | 22 | * Description : Main routine. |
| dousape2 | 1:8fc51018d66d | 23 | * Input : None. |
| dousape2 | 1:8fc51018d66d | 24 | * Output : None. |
| dousape2 | 1:8fc51018d66d | 25 | * Return : None. |
| dousape2 | 1:8fc51018d66d | 26 | ***********************************************************************************/ |
| dousape2 | 0:7b3cd0e11b6e | 27 | int main() { |
| dousape2 | 0:7b3cd0e11b6e | 28 | myIOs.mode(PullNone); // PullDown PullUp PullNone OpenDrain |
| dousape2 | 0:7b3cd0e11b6e | 29 | while(1) { |
| dousape2 | 0:7b3cd0e11b6e | 30 | if (myIOs.read() != 0xE000 && myIOs != 0xE000) { // Any of the 3 IOs is low, two posibility to read value |
| dousape2 | 0:7b3cd0e11b6e | 31 | myled = !myled; // Toggle LED state |
| dousape2 | 0:7b3cd0e11b6e | 32 | wait(0.2); |
| dousape2 | 0:7b3cd0e11b6e | 33 | } |
| dousape2 | 0:7b3cd0e11b6e | 34 | } |
| dousape2 | 0:7b3cd0e11b6e | 35 | } |
| dousape2 | 0:7b3cd0e11b6e | 36 |