FM-test
Dependencies: MODSERIAL mbed-rtos mbed
Fork of Master by
bluetooth.h@9:6057314dc8ec, 2014-09-13 (annotated)
- Committer:
- 9uS7
- Date:
- Sat Sep 13 11:03:52 2014 +0000
- Revision:
- 9:6057314dc8ec
- Parent:
- 6:df6d8ba1907a
- Child:
- 10:a90935ea0a4b
can control motor
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
9uS7 | 0:4f07ba929908 | 1 | #ifndef _INC_MY_BLUETOOTH |
9uS7 | 0:4f07ba929908 | 2 | #define _INC_MY_BLUETOOTH |
9uS7 | 0:4f07ba929908 | 3 | |
9uS7 | 0:4f07ba929908 | 4 | #include "mbed.h" |
9uS7 | 0:4f07ba929908 | 5 | |
9uS7 | 1:e1cfb5850088 | 6 | #define BT_MASTER 0 |
9uS7 | 1:e1cfb5850088 | 7 | #define BT_SLAVE -1 |
9uS7 | 1:e1cfb5850088 | 8 | |
9uS7 | 3:12e1f116ea42 | 9 | #define SYNC_SENSOR 0x10 |
9uS7 | 3:12e1f116ea42 | 10 | #define SYNC_MIC 0x11 |
9uS7 | 3:12e1f116ea42 | 11 | #define SYNC_MOTOR 0x20 |
9uS7 | 3:12e1f116ea42 | 12 | #define SYNC_FM 0x21 |
9uS7 | 3:12e1f116ea42 | 13 | |
9uS7 | 4:aaaadb45cbd9 | 14 | #define PACK_SIZE 15 |
9uS7 | 3:12e1f116ea42 | 15 | |
9uS7 | 0:4f07ba929908 | 16 | typedef union _cvt{ |
9uS7 | 3:12e1f116ea42 | 17 | char byte[4]; |
9uS7 | 3:12e1f116ea42 | 18 | int in; |
9uS7 | 3:12e1f116ea42 | 19 | float fl; |
9uS7 | 0:4f07ba929908 | 20 | } Cvt; |
9uS7 | 0:4f07ba929908 | 21 | |
9uS7 | 1:e1cfb5850088 | 22 | void btSetup(int); //setup(role) role:BT_MASTER or BT_SLAVE |
9uS7 | 0:4f07ba929908 | 23 | |
9uS7 | 3:12e1f116ea42 | 24 | void sync(char, char*, float*); //SYN(option,char_data,float_data); only for MASTER |
9uS7 | 3:12e1f116ea42 | 25 | |
9uS7 | 3:12e1f116ea42 | 26 | void slaveRecieve( void ); |
9uS7 | 6:df6d8ba1907a | 27 | void recieveSensor(float*, float*); |
9uS7 | 9:6057314dc8ec | 28 | void sendMotor( char function, float power ); |
9uS7 | 3:12e1f116ea42 | 29 | |
9uS7 | 2:c610e1a7fbcd | 30 | //void btLoop(int); //btLoop(role) role:BT_MASTER or BT_SLAVE |
9uS7 | 2:c610e1a7fbcd | 31 | |
9uS7 | 0:4f07ba929908 | 32 | #endif |