sensory_array
/
mbed_bluetooth_master
Diff: robotLibrary.h
- Revision:
- 0:65886aef87b1
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/robotLibrary.h Fri Mar 13 20:04:01 2015 +0000 @@ -0,0 +1,37 @@ +#ifndef INCL_ROBOTLIBRARY_H +#define INCL_ROBOTLIBRARY_H + +#include "mbed.h" +#include "USBSerial.h" + +#define bluetoothAvailable() (bt.readable()) +#define sendBluetoothChar(toSend) (bt.putc((char)toSend)) +#define getBluetoothChar() ((char) bt.getc()) +#include "string_functions.h" +#define robotPrint(toPrint) console1.printf(toPrint) +#define robotPrintln(toPrint) console1.printf(toPrint) + +#define PRINT_DEBUG 1 +#if PRINT_DEBUG == 1 +#define robotPrintDebug(toPrint) robotPrint(toPrint) +#define robotPrintlnDebug(toPrint) robotPrintln(toPrint) +#else +#define robotPrintDebug(toPrint) +#define robotPrintlnDebug(toPrint) +#endif + +extern Serial bt; // tx, rx +//extern USBSerial console1; +extern Serial console1; + +bool getBluetoothData(); +bool isBluetoothConnected(); +void processBluetoothData(); +char* returnBluetoothData(); +bool isBluetoothDataValid(); +void robotLoop(); +void robotSetup(); +void sendBluetoothData(const char* data); + + +#endif \ No newline at end of file