NXPCup_Cachan / Mbed 2 deprecated NXPCup

Dependencies:   mbed

Committer:
Wael_H
Date:
Wed Mar 11 14:24:48 2020 +0000
Revision:
2:1103f5d61035
Child:
3:07109a6bb472
publish IHM_bt pour ajout de commentaires

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Wael_H 2:1103f5d61035 1 #ifndef BT_H
Wael_H 2:1103f5d61035 2 #define BT_H
Wael_H 2:1103f5d61035 3
Wael_H 2:1103f5d61035 4 #include "mbed.h"
Wael_H 2:1103f5d61035 5 #include "math.h"
Wael_H 2:1103f5d61035 6
Wael_H 2:1103f5d61035 7 #define STARTBYTE 240
Wael_H 2:1103f5d61035 8 #define STOPBYTE 15
Wael_H 2:1103f5d61035 9
Wael_H 2:1103f5d61035 10 #define KPBYTE 30
Wael_H 2:1103f5d61035 11 #define KIBYTE 45
Wael_H 2:1103f5d61035 12 #define KDBYTE 60
Wael_H 2:1103f5d61035 13 #define SPCMDBYTE 75
Wael_H 2:1103f5d61035 14 #define CAMXBYTE 100
Wael_H 2:1103f5d61035 15 #define POSBYTE 130
Wael_H 2:1103f5d61035 16 #define LMBYTE 150
Wael_H 2:1103f5d61035 17 #define RMBYTE 165
Wael_H 2:1103f5d61035 18 #define ERRORBYTE 180
Wael_H 2:1103f5d61035 19 #define CERRBYTE 195
Wael_H 2:1103f5d61035 20 #define SGRABYTE 210
Wael_H 2:1103f5d61035 21
Wael_H 2:1103f5d61035 22 class IHM_Bluetooth
Wael_H 2:1103f5d61035 23 {
Wael_H 2:1103f5d61035 24 public:
Wael_H 2:1103f5d61035 25 IHM_Bluetooth();
Wael_H 2:1103f5d61035 26 void run(void);
Wael_H 2:1103f5d61035 27
Wael_H 2:1103f5d61035 28 private:
Wael_H 2:1103f5d61035 29 // FONCTIONS
Wael_H 2:1103f5d61035 30 void transmitBlu (void);
Wael_H 2:1103f5d61035 31 void receptionBlu (void);
Wael_H 2:1103f5d61035 32 void formatTrameT(short reg, int val);
Wael_H 2:1103f5d61035 33 int get_val_pc(short reg);
Wael_H 2:1103f5d61035 34 void TrameCAM(int CAM1, int CAM2);
Wael_H 2:1103f5d61035 35 void TramePos(int left, int barc, int right);
Wael_H 2:1103f5d61035 36 void automate_Tx(void);
Wael_H 2:1103f5d61035 37
Wael_H 2:1103f5d61035 38 // VARIABLES
Wael_H 2:1103f5d61035 39 unsigned int blueRxBuffer[6]; // Buffer de réception de la liaison série bluetooth
Wael_H 2:1103f5d61035 40 unsigned char blueTxBuffer[6]; // Buffer de transmission de la liaison série bluetooth
Wael_H 2:1103f5d61035 41 unsigned int paramRx[4]; //0 KP 1 KI 2 KD 3 SPEED
Wael_H 2:1103f5d61035 42 short cb_lm;
Wael_H 2:1103f5d61035 43 short cb_rm;
Wael_H 2:1103f5d61035 44 short cb_err;
Wael_H 2:1103f5d61035 45 short cb_cerr;
Wael_H 2:1103f5d61035 46 short cb_speed;
Wael_H 2:1103f5d61035 47 Ticker timer;
Wael_H 2:1103f5d61035 48 };
Wael_H 2:1103f5d61035 49
Wael_H 2:1103f5d61035 50 #endif // BT_H