Llibreria per fer servir un HC-06 o HC-05 en mode esclau. És compatible amb les llibreries RTOS de mbed.

Dependents:   projecte_v4_rtos ProjecteRobotFinal

Committer:
jcabello7
Date:
Mon Dec 21 17:21:34 2015 +0000
Revision:
1:cd73654d13ed
Parent:
0:acddf8d6d0cb
Child:
2:298c9cc5af48
Integra els c?lculs dels motors

Who changed what in which revision?

UserRevisionLine numberNew contents of line
jcabello7 0:acddf8d6d0cb 1 #ifndef MBED_HC05_H
jcabello7 0:acddf8d6d0cb 2 #define MBED_HC05_H
jcabello7 0:acddf8d6d0cb 3
jcabello7 0:acddf8d6d0cb 4 #include "mbed.h"
jcabello7 0:acddf8d6d0cb 5
jcabello7 0:acddf8d6d0cb 6 class Hc05 : public RawSerial {
jcabello7 0:acddf8d6d0cb 7 private:
jcabello7 0:acddf8d6d0cb 8 int mode, vel, ang;
jcabello7 1:cd73654d13ed 9 float m1, m2, m3, x, y;
jcabello7 0:acddf8d6d0cb 10 Timer timer;
jcabello7 0:acddf8d6d0cb 11 char strLlegit[longString];
jcabello7 0:acddf8d6d0cb 12 public:
jcabello7 0:acddf8d6d0cb 13 Hc05(PinName tx, PinName rx);
jcabello7 0:acddf8d6d0cb 14 ~Hc05();
jcabello7 0:acddf8d6d0cb 15 void iniString();
jcabello7 0:acddf8d6d0cb 16 void enviaString(char* str);
jcabello7 0:acddf8d6d0cb 17 bool llegirString();
jcabello7 0:acddf8d6d0cb 18 void tractaString();
jcabello7 0:acddf8d6d0cb 19 int getMode();
jcabello7 0:acddf8d6d0cb 20 int getVel();
jcabello7 0:acddf8d6d0cb 21 int getAng();
jcabello7 0:acddf8d6d0cb 22 void getStringLlegit(char* str);
jcabello7 0:acddf8d6d0cb 23 void comprovaConnexio();
jcabello7 0:acddf8d6d0cb 24 int getTimer();
jcabello7 1:cd73654d13ed 25 //Calculs
jcabello7 1:cd73654d13ed 26 void calculaMotors();
jcabello7 1:cd73654d13ed 27 float getM1();
jcabello7 1:cd73654d13ed 28 float getM2();
jcabello7 1:cd73654d13ed 29 float getM3();
jcabello7 1:cd73654d13ed 30 float getX();
jcabello7 1:cd73654d13ed 31 float getY();
jcabello7 0:acddf8d6d0cb 32 };
jcabello7 0:acddf8d6d0cb 33
jcabello7 0:acddf8d6d0cb 34 #endif