e

Dependencies:   NeoStrip USBDevice mbed

Committer:
baraki
Date:
Tue Sep 22 21:49:44 2015 +0000
Revision:
0:5b9f87a086ce
for use with blue mbed

Who changed what in which revision?

UserRevisionLine numberNew contents of line
baraki 0:5b9f87a086ce 1 #ifndef INCL_ROBOTLIBRARY_H
baraki 0:5b9f87a086ce 2 #define INCL_ROBOTLIBRARY_H
baraki 0:5b9f87a086ce 3
baraki 0:5b9f87a086ce 4 #include "mbed.h"
baraki 0:5b9f87a086ce 5 #include "USBSerial.h"
baraki 0:5b9f87a086ce 6
baraki 0:5b9f87a086ce 7 #define bluetoothAvailable() (bt.readable())
baraki 0:5b9f87a086ce 8 #define sendBluetoothChar(toSend) (bt.putc((char)toSend))
baraki 0:5b9f87a086ce 9 #define getBluetoothChar() ((char) bt.getc())
baraki 0:5b9f87a086ce 10 #include "string_functions.h"
baraki 0:5b9f87a086ce 11 //#define robotPrint(toPrint) console1.printf(toPrint)
baraki 0:5b9f87a086ce 12 //#define robotPrintln(toPrint) console1.printf(toPrint)
baraki 0:5b9f87a086ce 13
baraki 0:5b9f87a086ce 14 #define PRINT_DEBUG 0
baraki 0:5b9f87a086ce 15 #if PRINT_DEBUG == 1
baraki 0:5b9f87a086ce 16 //#define robotPrintDebug(toPrint) robotPrint(toPrint)
baraki 0:5b9f87a086ce 17 //#define robotPrintlnDebug(toPrint) robotPrintln(toPrint)
baraki 0:5b9f87a086ce 18 #else
baraki 0:5b9f87a086ce 19 //#define robotPrintDebug(toPrint)
baraki 0:5b9f87a086ce 20 //#define robotPrintlnDebug(toPrint)
baraki 0:5b9f87a086ce 21 #endif
baraki 0:5b9f87a086ce 22
baraki 0:5b9f87a086ce 23 extern Serial bt; // tx, rx
baraki 0:5b9f87a086ce 24 //extern USBSerial console1;
baraki 0:5b9f87a086ce 25 extern char bluetoothData[50];
baraki 0:5b9f87a086ce 26 bool getBluetoothData();
baraki 0:5b9f87a086ce 27 bool isBluetoothConnected();
baraki 0:5b9f87a086ce 28 void setBluetoothConnected(bool btCon);
baraki 0:5b9f87a086ce 29 void processBluetoothData();
baraki 0:5b9f87a086ce 30 char* returnBluetoothData();
baraki 0:5b9f87a086ce 31 bool isBluetoothDataValid();
baraki 0:5b9f87a086ce 32 void robotLoop();
baraki 0:5b9f87a086ce 33 void robotSetup(int baud_rate);
baraki 0:5b9f87a086ce 34 void sendBluetoothData(const char* data);
baraki 0:5b9f87a086ce 35
baraki 0:5b9f87a086ce 36 #endif