FM-test

Dependencies:   MODSERIAL mbed-rtos mbed

Fork of Master by Ohnishi_Gundan

Committer:
9uS7
Date:
Mon Sep 15 04:05:56 2014 +0000
Revision:
13:3f0505bbe284
Parent:
10:a90935ea0a4b
add fmStop and fmRestart

Who changed what in which revision?

UserRevisionLine numberNew 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 10:a90935ea0a4b 24 int readPack( char* );
9uS7 10:a90935ea0a4b 25
9uS7 3:12e1f116ea42 26 void sync(char, char*, float*); //SYN(option,char_data,float_data); only for MASTER
9uS7 3:12e1f116ea42 27
9uS7 3:12e1f116ea42 28 void slaveRecieve( void );
9uS7 6:df6d8ba1907a 29 void recieveSensor(float*, float*);
9uS7 9:6057314dc8ec 30 void sendMotor( char function, float power );
9uS7 3:12e1f116ea42 31
9uS7 2:c610e1a7fbcd 32 //void btLoop(int); //btLoop(role) role:BT_MASTER or BT_SLAVE
9uS7 2:c610e1a7fbcd 33
9uS7 0:4f07ba929908 34 #endif