Cambios

Dependencies:   mbed Adafruit_GFX SeeedShieldBot BluetoothSerial

Files at this revision

API Documentation at this revision

Comitter:
aitor98
Date:
Tue Dec 22 10:51:27 2020 +0000
Parent:
3:b33d698b0a5c
Child:
5:e3fe2afec9b6
Commit message:
Casifinal

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Mon Dec 21 16:26:20 2020 +0000
+++ b/main.cpp	Tue Dec 22 10:51:27 2020 +0000
@@ -3,7 +3,7 @@
 #include "Adafruit_SSD1306.h"
 
 
-class I2CPreInit : public I2C
+/*class I2CPreInit : public I2C
 {
 public:
     I2CPreInit(PinName sda, PinName scl) : I2C(sda, scl)
@@ -14,7 +14,7 @@
 };
 
 I2CPreInit gI2C(PB_9,PB_8);
-Adafruit_SSD1306_I2c gOled(gI2C,NC,0x78,64,128);
+Adafruit_SSD1306_I2c gOled(gI2C,NC,0x78,64,128);*/
 
 Serial pc(USBTX, USBRX); // tx, rx
 Serial bt(A5, A4); // tx, rx
@@ -30,7 +30,7 @@
 DigitalOut rele(D3);
 HCSR04  usensor(D7,D8);
 DigitalIn final1(D9);
-InterruptIn final2(D10);
+DigitalIn final2(D10);
 AnalogIn Vout(A0);
 AnalogIn Aout(A1);
 
@@ -59,12 +59,12 @@
         if (dato=='1') {            //Si el dato es un 1 comienza el proceso
 
             estado = movder;
-            gOled.printf("Fabricando\n");
+          /*  gOled.printf("Fabricando\n");*/
             bt.printf("Transportando a calentador\n");
 
 
         } else {   
-        bt.printf("Reposo\n");   //Si el dato es cualquier otra cosa no empieza a hacer nada
+        /*bt.printf("Reposo\n");*/   //Si el dato es cualquier otra cosa no empieza a hacer nada
         }
     }
 }
@@ -156,6 +156,7 @@
             
             bt.printf("Pieza correcta\n");
             bt.printf("Transportando a soplador\n");
+            wait(0.01);
         }
     }
 }
@@ -186,7 +187,7 @@
     dirBMotor=0;
     estado=inicio;
 
-    gOled.printf("Reposo\n");
+   /* gOled.printf("Reposo\n");*/
     bt.printf("Reposo\n");
     
 
@@ -198,7 +199,7 @@
 {
     pc.baud(115200);
     estado = inicio;
-    gOled.begin();
+  /*  gOled.begin();*/
 
     repeticion.attach(&medir_corriente, 10.0); //Medir la intensidad cada tres segundos