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: USBDevice mbed mbed-rtos
bluetoothComm.h@0:7c2805142589, 2015-03-26 (annotated)
- Committer:
- baraki
- Date:
- Thu Mar 26 16:57:07 2015 +0000
- Revision:
- 0:7c2805142589
- Child:
- 2:1a0d675eaa6f
single threaded slave
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 | 0:7c2805142589 | 11 | #define robotPrint(toPrint) console1.printf(toPrint) |
| baraki | 0:7c2805142589 | 12 | #define robotPrintln(toPrint) console1.printf(toPrint) |
| baraki | 0:7c2805142589 | 13 | |
| baraki | 0:7c2805142589 | 14 | #define PRINT_DEBUG 1 |
| baraki | 0:7c2805142589 | 15 | #if PRINT_DEBUG == 1 |
| baraki | 0:7c2805142589 | 16 | #define robotPrintDebug(toPrint) robotPrint(toPrint) |
| baraki | 0:7c2805142589 | 17 | #define robotPrintlnDebug(toPrint) robotPrintln(toPrint) |
| baraki | 0:7c2805142589 | 18 | #else |
| baraki | 0:7c2805142589 | 19 | #define robotPrintDebug(toPrint) |
| baraki | 0:7c2805142589 | 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 |