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: RPCInterface-rtos mbed-rpc mbed-rtos mbed
main.cpp@0:65b08d6df124, 2015-04-09 (annotated)
- Committer:
- ban4jp
- Date:
- Thu Apr 09 18:03:39 2015 +0000
- Revision:
- 0:65b08d6df124
initial commit.
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| ban4jp | 0:65b08d6df124 | 1 | #include "mbed.h" |
| ban4jp | 0:65b08d6df124 | 2 | #include "rtos.h" |
| ban4jp | 0:65b08d6df124 | 3 | #include "SerialRPCInterface.h" |
| ban4jp | 0:65b08d6df124 | 4 | |
| ban4jp | 0:65b08d6df124 | 5 | DigitalOut led1(LED1); |
| ban4jp | 0:65b08d6df124 | 6 | DigitalOut led2(LED2); |
| ban4jp | 0:65b08d6df124 | 7 | |
| ban4jp | 0:65b08d6df124 | 8 | void led2_thread(void const *args) |
| ban4jp | 0:65b08d6df124 | 9 | { |
| ban4jp | 0:65b08d6df124 | 10 | while (true) { |
| ban4jp | 0:65b08d6df124 | 11 | led2 = !led2; |
| ban4jp | 0:65b08d6df124 | 12 | Thread::wait(1000); |
| ban4jp | 0:65b08d6df124 | 13 | } |
| ban4jp | 0:65b08d6df124 | 14 | } |
| ban4jp | 0:65b08d6df124 | 15 | |
| ban4jp | 0:65b08d6df124 | 16 | int main() |
| ban4jp | 0:65b08d6df124 | 17 | { |
| ban4jp | 0:65b08d6df124 | 18 | SerialRPCInterface rpc(USBTX, USBRX); |
| ban4jp | 0:65b08d6df124 | 19 | Thread thread(led2_thread); |
| ban4jp | 0:65b08d6df124 | 20 | |
| ban4jp | 0:65b08d6df124 | 21 | while (true) { |
| ban4jp | 0:65b08d6df124 | 22 | led1 = !led1; |
| ban4jp | 0:65b08d6df124 | 23 | Thread::wait(500); |
| ban4jp | 0:65b08d6df124 | 24 | } |
| ban4jp | 0:65b08d6df124 | 25 | } |