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: MTS-Serial libmDot mbed-rtos mbed
Fork of mDot_USB_AT_firmware by
main.cpp@0:e2b8246361bc, 2015-06-25 (annotated)
- Committer:
- mfiore
- Date:
- Thu Jun 25 14:52:56 2015 +0000
- Revision:
- 0:e2b8246361bc
- Child:
- 1:e52ae6584f1c
initial commit, main, debug, version, wakeup, doc
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| mfiore | 0:e2b8246361bc | 1 | #include "mbed.h" |
| mfiore | 0:e2b8246361bc | 2 | #include "mDot.h" |
| mfiore | 0:e2b8246361bc | 3 | #include "CommandTerminal.h" |
| mfiore | 0:e2b8246361bc | 4 | |
| mfiore | 0:e2b8246361bc | 5 | Serial debug(USBTX, USBRX); |
| mfiore | 0:e2b8246361bc | 6 | |
| mfiore | 0:e2b8246361bc | 7 | mts::MTSSerial serial(XBEE_DOUT, XBEE_DIN, 512, 512); |
| mfiore | 0:e2b8246361bc | 8 | DigitalOut led(LED1); |
| mfiore | 0:e2b8246361bc | 9 | Ticker tick; |
| mfiore | 0:e2b8246361bc | 10 | |
| mfiore | 0:e2b8246361bc | 11 | void tock() { |
| mfiore | 0:e2b8246361bc | 12 | led = !led; |
| mfiore | 0:e2b8246361bc | 13 | } |
| mfiore | 0:e2b8246361bc | 14 | |
| mfiore | 0:e2b8246361bc | 15 | int main() |
| mfiore | 0:e2b8246361bc | 16 | { |
| mfiore | 0:e2b8246361bc | 17 | debug.baud(115200); |
| mfiore | 0:e2b8246361bc | 18 | |
| mfiore | 0:e2b8246361bc | 19 | tick.attach(&tock, 0.5); |
| mfiore | 0:e2b8246361bc | 20 | |
| mfiore | 0:e2b8246361bc | 21 | mDot* dot = mDot::getInstance(); |
| mfiore | 0:e2b8246361bc | 22 | |
| mfiore | 0:e2b8246361bc | 23 | debug.baud(dot->getDebugBaud()); |
| mfiore | 0:e2b8246361bc | 24 | serial.baud(dot->getBaud()); |
| mfiore | 0:e2b8246361bc | 25 | |
| mfiore | 0:e2b8246361bc | 26 | CommandTerminal term(serial, dot); |
| mfiore | 0:e2b8246361bc | 27 | |
| mfiore | 0:e2b8246361bc | 28 | term.start(); |
| mfiore | 0:e2b8246361bc | 29 | } |
