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.
Fork of daplink-validation by
main.cpp@0:c4a3bb148a79, 2015-09-10 (annotated)
- Committer:
- c1728p9
- Date:
- Thu Sep 10 16:03:46 2015 +0000
- Revision:
- 0:c4a3bb148a79
- Child:
- 1:db2a55107c7e
lpc800 blinkey
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| c1728p9 | 0:c4a3bb148a79 | 1 | #include "mbed.h" |
| c1728p9 | 0:c4a3bb148a79 | 2 | |
| c1728p9 | 0:c4a3bb148a79 | 3 | DigitalOut myled1(LED1); |
| c1728p9 | 0:c4a3bb148a79 | 4 | DigitalOut myled2(LED2); |
| c1728p9 | 0:c4a3bb148a79 | 5 | DigitalOut myled3(LED3); |
| c1728p9 | 0:c4a3bb148a79 | 6 | //Serial pc(P0_6, P0_1); |
| c1728p9 | 0:c4a3bb148a79 | 7 | Serial pc(USBTX, USBRX); |
| c1728p9 | 0:c4a3bb148a79 | 8 | |
| c1728p9 | 0:c4a3bb148a79 | 9 | float blink_time = 0.5; |
| c1728p9 | 0:c4a3bb148a79 | 10 | |
| c1728p9 | 0:c4a3bb148a79 | 11 | int main() { |
| c1728p9 | 0:c4a3bb148a79 | 12 | pc.baud(115200); |
| c1728p9 | 0:c4a3bb148a79 | 13 | myled1 = 1; |
| c1728p9 | 0:c4a3bb148a79 | 14 | myled3 = 1; |
| c1728p9 | 0:c4a3bb148a79 | 15 | myled2 = 1; |
| c1728p9 | 0:c4a3bb148a79 | 16 | while(1) { |
| c1728p9 | 0:c4a3bb148a79 | 17 | myled1 = 0; |
| c1728p9 | 0:c4a3bb148a79 | 18 | wait(blink_time); |
| c1728p9 | 0:c4a3bb148a79 | 19 | myled1 = 1; |
| c1728p9 | 0:c4a3bb148a79 | 20 | wait(blink_time); |
| c1728p9 | 0:c4a3bb148a79 | 21 | |
| c1728p9 | 0:c4a3bb148a79 | 22 | myled2 = 0; |
| c1728p9 | 0:c4a3bb148a79 | 23 | wait(blink_time); |
| c1728p9 | 0:c4a3bb148a79 | 24 | myled2 = 1; |
| c1728p9 | 0:c4a3bb148a79 | 25 | wait(blink_time); |
| c1728p9 | 0:c4a3bb148a79 | 26 | |
| c1728p9 | 0:c4a3bb148a79 | 27 | myled3 = 0; |
| c1728p9 | 0:c4a3bb148a79 | 28 | wait(blink_time); |
| c1728p9 | 0:c4a3bb148a79 | 29 | myled3 = 1; |
| c1728p9 | 0:c4a3bb148a79 | 30 | wait(blink_time); |
| c1728p9 | 0:c4a3bb148a79 | 31 | pc.printf("Some data\r\n"); |
| c1728p9 | 0:c4a3bb148a79 | 32 | |
| c1728p9 | 0:c4a3bb148a79 | 33 | } |
| c1728p9 | 0:c4a3bb148a79 | 34 | } |
