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:6e1e4116e0bd, 2020-12-23 (annotated)
- Committer:
- piroro4560
- Date:
- Wed Dec 23 08:20:22 2020 +0000
- Revision:
- 1:6e1e4116e0bd
- Parent:
- 0:4db87cec0fe6
shuusei
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
piroro4560 | 0:4db87cec0fe6 | 1 | #include "mbed.h" |
piroro4560 | 0:4db87cec0fe6 | 2 | |
piroro4560 | 0:4db87cec0fe6 | 3 | DigitalOut LED(LED1); |
piroro4560 | 1:6e1e4116e0bd | 4 | DigitalIn button(USER_BUTTON); |
piroro4560 | 0:4db87cec0fe6 | 5 | Serial pc(USBTX, USBRX、115200); // tx, rx |
piroro4560 | 0:4db87cec0fe6 | 6 | |
piroro4560 | 0:4db87cec0fe6 | 7 | int main() { |
piroro4560 | 0:4db87cec0fe6 | 8 | while(1) { |
piroro4560 | 0:4db87cec0fe6 | 9 | wait_ms(200); |
piroro4560 | 0:4db87cec0fe6 | 10 | LED = !LED; |
piroro4560 | 0:4db87cec0fe6 | 11 | pc.printf("success\t"); |
piroro4560 | 1:6e1e4116e0bd | 12 | if (button) pc.printf("button is on"); |
piroro4560 | 0:4db87cec0fe6 | 13 | pc.printf("\r\n"); |
piroro4560 | 0:4db87cec0fe6 | 14 | } |
piroro4560 | 0:4db87cec0fe6 | 15 | } |