sensory_array
/
mbed_bluetooth_master
towards master bluetooth mode, currently working on slavemode
robotLibrary.h@0:65886aef87b1, 2015-03-13 (annotated)
- Committer:
- rkk
- Date:
- Fri Mar 13 20:04:01 2015 +0000
- Revision:
- 0:65886aef87b1
slave functionality works
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
rkk | 0:65886aef87b1 | 1 | #ifndef INCL_ROBOTLIBRARY_H |
rkk | 0:65886aef87b1 | 2 | #define INCL_ROBOTLIBRARY_H |
rkk | 0:65886aef87b1 | 3 | |
rkk | 0:65886aef87b1 | 4 | #include "mbed.h" |
rkk | 0:65886aef87b1 | 5 | #include "USBSerial.h" |
rkk | 0:65886aef87b1 | 6 | |
rkk | 0:65886aef87b1 | 7 | #define bluetoothAvailable() (bt.readable()) |
rkk | 0:65886aef87b1 | 8 | #define sendBluetoothChar(toSend) (bt.putc((char)toSend)) |
rkk | 0:65886aef87b1 | 9 | #define getBluetoothChar() ((char) bt.getc()) |
rkk | 0:65886aef87b1 | 10 | #include "string_functions.h" |
rkk | 0:65886aef87b1 | 11 | #define robotPrint(toPrint) console1.printf(toPrint) |
rkk | 0:65886aef87b1 | 12 | #define robotPrintln(toPrint) console1.printf(toPrint) |
rkk | 0:65886aef87b1 | 13 | |
rkk | 0:65886aef87b1 | 14 | #define PRINT_DEBUG 1 |
rkk | 0:65886aef87b1 | 15 | #if PRINT_DEBUG == 1 |
rkk | 0:65886aef87b1 | 16 | #define robotPrintDebug(toPrint) robotPrint(toPrint) |
rkk | 0:65886aef87b1 | 17 | #define robotPrintlnDebug(toPrint) robotPrintln(toPrint) |
rkk | 0:65886aef87b1 | 18 | #else |
rkk | 0:65886aef87b1 | 19 | #define robotPrintDebug(toPrint) |
rkk | 0:65886aef87b1 | 20 | #define robotPrintlnDebug(toPrint) |
rkk | 0:65886aef87b1 | 21 | #endif |
rkk | 0:65886aef87b1 | 22 | |
rkk | 0:65886aef87b1 | 23 | extern Serial bt; // tx, rx |
rkk | 0:65886aef87b1 | 24 | //extern USBSerial console1; |
rkk | 0:65886aef87b1 | 25 | extern Serial console1; |
rkk | 0:65886aef87b1 | 26 | |
rkk | 0:65886aef87b1 | 27 | bool getBluetoothData(); |
rkk | 0:65886aef87b1 | 28 | bool isBluetoothConnected(); |
rkk | 0:65886aef87b1 | 29 | void processBluetoothData(); |
rkk | 0:65886aef87b1 | 30 | char* returnBluetoothData(); |
rkk | 0:65886aef87b1 | 31 | bool isBluetoothDataValid(); |
rkk | 0:65886aef87b1 | 32 | void robotLoop(); |
rkk | 0:65886aef87b1 | 33 | void robotSetup(); |
rkk | 0:65886aef87b1 | 34 | void sendBluetoothData(const char* data); |
rkk | 0:65886aef87b1 | 35 | |
rkk | 0:65886aef87b1 | 36 | |
rkk | 0:65886aef87b1 | 37 | #endif |