Només falta afegir les vostres parts, a mi em falta fer la comprovació de la connexió. S'hauria de separar les classes en arxius separats per deixar-ho més net.

Dependencies:   mbed-rtos mbed Hc05 RawSerialPc

Files at this revision

API Documentation at this revision

Comitter:
jcabello7
Date:
Wed Dec 16 18:09:25 2015 +0000
Parent:
1:c603de57c8b6
Child:
3:4a598ab10e87
Commit message:
afegit mode automatic (mode=3)

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Wed Dec 16 16:06:25 2015 +0000
+++ b/main.cpp	Wed Dec 16 18:09:25 2015 +0000
@@ -5,6 +5,8 @@
 // ---- NO TOCAR DESDE AQUI ----
 // -----------------------------
 
+//0, 60, 120, 180 i en negatiu
+
 #define longString 128 //longString es la longitud màxima del string
 
 class Pc : public RawSerial {
@@ -112,6 +114,8 @@
                 vel = atoi(svel);
                 ang = atoi(sang);
             }
+            if ((strLlegit[0] == 'm') && (strLlegit[1] == 'o') && (strLlegit[2] == 'd') && (strLlegit[3] == 'e') && (strLlegit[5] == 'a') && (strLlegit[6] == 'u') && (strLlegit[7] == 't') && (strLlegit[8] == 'o'))
+                mode = 3;
         };
         
         int getMode(){return mode;};
@@ -131,7 +135,7 @@
 // ----------------------------
 
 Pc pc(USBTX, USBRX);    //Per provar si funciona, no cal al programa
-Hc05 bt(D8, D2);        //Crea l'objecte bt, connectat als pins D8 i D2 (és la connexió sèrie BT)
+Hc05 bt(D8, D2);        //Crea l'objecte bt, connectat als pins D8 (TX) i D2 (RX) (és la connexió sèrie BT)
 char prova[longString] = "hola"; //Per provar si funciona, no cal al programa