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@3:7d5a6c251111, 2021-05-07 (annotated)
- Committer:
- 19010100419
- Date:
- Fri May 07 12:00:26 2021 +0000
- Revision:
- 3:7d5a6c251111
- Parent:
- 2:c9378e6122a7
nucleo uart
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| bcostm | 0:028fac66239d | 1 | #include "mbed.h" |
| Anuprit123 | 2:c9378e6122a7 | 2 | #include <string.h> |
| bcostm | 1:e9d1c42a73ae | 3 | |
| bcostm | 1:e9d1c42a73ae | 4 | //------------------------------------ |
| bcostm | 1:e9d1c42a73ae | 5 | // Hyperterminal configuration |
| bcostm | 1:e9d1c42a73ae | 6 | // 9600 bauds, 8-bit data, no parity |
| bcostm | 1:e9d1c42a73ae | 7 | //------------------------------------ |
| bcostm | 0:028fac66239d | 8 | Serial pc(SERIAL_TX, SERIAL_RX); |
| 19010100419 | 3:7d5a6c251111 | 9 | DigitalOut myled(LED1); |
| Anuprit123 | 2:c9378e6122a7 | 10 | /* |
| Anuprit123 | 2:c9378e6122a7 | 11 | * Author: Edoardo De Marchi |
| Anuprit123 | 2:c9378e6122a7 | 12 | * Date: 22-08-14 |
| Anuprit123 | 2:c9378e6122a7 | 13 | * Notes: Firmware for GPS U-Blox NEO-6M |
| Anuprit123 | 2:c9378e6122a7 | 14 | */ |
| Anuprit123 | 2:c9378e6122a7 | 15 | |
| Anuprit123 | 2:c9378e6122a7 | 16 | |
| Anuprit123 | 2:c9378e6122a7 | 17 | |
| Anuprit123 | 2:c9378e6122a7 | 18 | int main() |
| Anuprit123 | 2:c9378e6122a7 | 19 | { |
| 19010100419 | 3:7d5a6c251111 | 20 | pc.printf("Press 'u' to turn LED on,'d' for off\n"); |
| 19010100419 | 3:7d5a6c251111 | 21 | while(1) |
| Anuprit123 | 2:c9378e6122a7 | 22 | { |
| 19010100419 | 3:7d5a6c251111 | 23 | char c = pc.getc(); |
| 19010100419 | 3:7d5a6c251111 | 24 | wait (0.001); |
| 19010100419 | 3:7d5a6c251111 | 25 | if(c == 'u') |
| 19010100419 | 3:7d5a6c251111 | 26 | { |
| 19010100419 | 3:7d5a6c251111 | 27 | myled = 1; |
| Anuprit123 | 2:c9378e6122a7 | 28 | } |
| 19010100419 | 3:7d5a6c251111 | 29 | if(c == 'd') |
| 19010100419 | 3:7d5a6c251111 | 30 | { |
| 19010100419 | 3:7d5a6c251111 | 31 | myled = 0; |
| 19010100419 | 3:7d5a6c251111 | 32 | } |
| Anuprit123 | 2:c9378e6122a7 | 33 | } |
| Anuprit123 | 2:c9378e6122a7 | 34 | |
| Anuprit123 | 2:c9378e6122a7 | 35 | } |
| Anuprit123 | 2:c9378e6122a7 | 36 | |
| Anuprit123 | 2:c9378e6122a7 | 37 | |
| Anuprit123 | 2:c9378e6122a7 | 38 | |
| Anuprit123 | 2:c9378e6122a7 | 39 |