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:f23656783084, 2012-05-14 (annotated)
- Committer:
- emilmont
- Date:
- Mon May 14 14:15:01 2012 +0000
- Revision:
- 0:f23656783084
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| emilmont | 0:f23656783084 | 1 | #include "mbed.h" |
| emilmont | 0:f23656783084 | 2 | #include "cmsis_os.h" |
| emilmont | 0:f23656783084 | 3 | |
| emilmont | 0:f23656783084 | 4 | DigitalOut led1(LED1); |
| emilmont | 0:f23656783084 | 5 | DigitalOut led2(LED2); |
| emilmont | 0:f23656783084 | 6 | |
| emilmont | 0:f23656783084 | 7 | void led2_thread(void const *argument) { |
| emilmont | 0:f23656783084 | 8 | while (true) { |
| emilmont | 0:f23656783084 | 9 | led2 = !led2; |
| emilmont | 0:f23656783084 | 10 | osDelay(1000); |
| emilmont | 0:f23656783084 | 11 | } |
| emilmont | 0:f23656783084 | 12 | } |
| emilmont | 0:f23656783084 | 13 | osThreadDef(led2_thread, osPriorityNormal, 1, DEFAULT_STACK_SIZE); |
| emilmont | 0:f23656783084 | 14 | |
| emilmont | 0:f23656783084 | 15 | int main() { |
| emilmont | 0:f23656783084 | 16 | osThreadCreate(osThread(led2_thread), NULL); |
| emilmont | 0:f23656783084 | 17 | |
| emilmont | 0:f23656783084 | 18 | while (true) { |
| emilmont | 0:f23656783084 | 19 | led1 = !led1; |
| emilmont | 0:f23656783084 | 20 | osDelay(500); |
| emilmont | 0:f23656783084 | 21 | } |
| emilmont | 0:f23656783084 | 22 | } |