haptic belt slave code that runs on single thread
Dependencies: USBDevice mbed mbed-rtos
bluetoothComm.h@5:301515ccaddc, 2015-03-27 (annotated)
- Committer:
- baraki
- Date:
- Fri Mar 27 15:32:29 2015 +0000
- Revision:
- 5:301515ccaddc
- Parent:
- 3:6a249e8de7d8
works with rtos timer now and we have all 7 pwms
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
baraki | 0:7c2805142589 | 1 | #ifndef INCL_ROBOTLIBRARY_H |
baraki | 0:7c2805142589 | 2 | #define INCL_ROBOTLIBRARY_H |
baraki | 0:7c2805142589 | 3 | |
baraki | 0:7c2805142589 | 4 | #include "mbed.h" |
baraki | 0:7c2805142589 | 5 | #include "USBSerial.h" |
baraki | 0:7c2805142589 | 6 | |
baraki | 0:7c2805142589 | 7 | #define bluetoothAvailable() (bt.readable()) |
baraki | 0:7c2805142589 | 8 | #define sendBluetoothChar(toSend) (bt.putc((char)toSend)) |
baraki | 0:7c2805142589 | 9 | #define getBluetoothChar() ((char) bt.getc()) |
baraki | 0:7c2805142589 | 10 | #include "string_functions.h" |
baraki | 3:6a249e8de7d8 | 11 | //#define robotPrint(toPrint) console1.printf(toPrint) |
baraki | 3:6a249e8de7d8 | 12 | //#define robotPrintln(toPrint) console1.printf(toPrint) |
baraki | 0:7c2805142589 | 13 | |
baraki | 2:1a0d675eaa6f | 14 | #define PRINT_DEBUG 0 |
baraki | 0:7c2805142589 | 15 | #if PRINT_DEBUG == 1 |
baraki | 3:6a249e8de7d8 | 16 | //#define robotPrintDebug(toPrint) robotPrint(toPrint) |
baraki | 3:6a249e8de7d8 | 17 | //#define robotPrintlnDebug(toPrint) robotPrintln(toPrint) |
baraki | 0:7c2805142589 | 18 | #else |
baraki | 3:6a249e8de7d8 | 19 | //#define robotPrintDebug(toPrint) |
baraki | 3:6a249e8de7d8 | 20 | //#define robotPrintlnDebug(toPrint) |
baraki | 0:7c2805142589 | 21 | #endif |
baraki | 0:7c2805142589 | 22 | |
baraki | 0:7c2805142589 | 23 | extern Serial bt; // tx, rx |
baraki | 0:7c2805142589 | 24 | extern USBSerial console1; |
baraki | 0:7c2805142589 | 25 | extern char bluetoothData[50]; |
baraki | 0:7c2805142589 | 26 | bool getBluetoothData(); |
baraki | 0:7c2805142589 | 27 | bool isBluetoothConnected(); |
baraki | 0:7c2805142589 | 28 | void setBluetoothConnected(bool btCon); |
baraki | 0:7c2805142589 | 29 | void processBluetoothData(); |
baraki | 0:7c2805142589 | 30 | char* returnBluetoothData(); |
baraki | 0:7c2805142589 | 31 | bool isBluetoothDataValid(); |
baraki | 0:7c2805142589 | 32 | void robotLoop(); |
baraki | 0:7c2805142589 | 33 | void robotSetup(int baud_rate); |
baraki | 0:7c2805142589 | 34 | void sendBluetoothData(const char* data); |
baraki | 0:7c2805142589 | 35 | |
baraki | 0:7c2805142589 | 36 | #endif |