BlueTooth HC-05 module running on a ST-Nucleo-F303K8
Dependents: Nucleo_interf_bluetooth
Work version with the "BT Bot Control" app for Android. Running on a NuCleo-F303K8 and a HC-05 bluetooth module.
HC05.h@0:e0c6e95761d2, 2016-02-04 (annotated)
- Committer:
- Kio_Liex
- Date:
- Thu Feb 04 20:18:06 2016 +0000
- Revision:
- 0:e0c6e95761d2
BlueTooth HC-05 module running on a ST-Nucleo-F303K8
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Kio_Liex | 0:e0c6e95761d2 | 1 | #ifndef _HC05_H_ |
Kio_Liex | 0:e0c6e95761d2 | 2 | #define _HC05_H_ |
Kio_Liex | 0:e0c6e95761d2 | 3 | |
Kio_Liex | 0:e0c6e95761d2 | 4 | #include "mbed.h" |
Kio_Liex | 0:e0c6e95761d2 | 5 | |
Kio_Liex | 0:e0c6e95761d2 | 6 | #define SOP 's' |
Kio_Liex | 0:e0c6e95761d2 | 7 | #define EOP 'e' |
Kio_Liex | 0:e0c6e95761d2 | 8 | |
Kio_Liex | 0:e0c6e95761d2 | 9 | class HC05 |
Kio_Liex | 0:e0c6e95761d2 | 10 | { |
Kio_Liex | 0:e0c6e95761d2 | 11 | Serial myBT; |
Kio_Liex | 0:e0c6e95761d2 | 12 | |
Kio_Liex | 0:e0c6e95761d2 | 13 | int index; |
Kio_Liex | 0:e0c6e95761d2 | 14 | |
Kio_Liex | 0:e0c6e95761d2 | 15 | char btData[20]; |
Kio_Liex | 0:e0c6e95761d2 | 16 | char btChar; |
Kio_Liex | 0:e0c6e95761d2 | 17 | |
Kio_Liex | 0:e0c6e95761d2 | 18 | bool started; |
Kio_Liex | 0:e0c6e95761d2 | 19 | bool ended; |
Kio_Liex | 0:e0c6e95761d2 | 20 | |
Kio_Liex | 0:e0c6e95761d2 | 21 | public: |
Kio_Liex | 0:e0c6e95761d2 | 22 | HC05(PinName tx, PinName rx); |
Kio_Liex | 0:e0c6e95761d2 | 23 | void getValue(int16_t* xVal, int16_t* yVal, int16_t* cVal); |
Kio_Liex | 0:e0c6e95761d2 | 24 | }; |
Kio_Liex | 0:e0c6e95761d2 | 25 | |
Kio_Liex | 0:e0c6e95761d2 | 26 | #endif /* _HC05_H_ */ |