mDot AT-Firmware for testing
Dependencies: MTS-Serial libmDot-mbed5
Fork of Dot-AT-Firmware by
main.cpp@1:e52ae6584f1c, 2015-06-25 (annotated)
- Committer:
- Mike Fiore
- Date:
- Thu Jun 25 10:23:41 2015 -0500
- Revision:
- 1:e52ae6584f1c
- Parent:
- 0:e2b8246361bc
- Child:
- 4:666017851052
update debug, add command source files
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(); |
Mike Fiore |
1:e52ae6584f1c | 29 | } |