ultimaact

Dependencies:   mbed Adafruit_GFX

Files at this revision

API Documentation at this revision

Comitter:
davidmateos
Date:
Tue Dec 14 08:57:43 2021 +0000
Parent:
8:a071c579f9ea
Commit message:
printf bien hecho

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r a071c579f9ea -r d651ed116942 main.cpp
--- a/main.cpp	Mon Dec 13 20:12:05 2021 +0000
+++ b/main.cpp	Tue Dec 14 08:57:43 2021 +0000
@@ -21,7 +21,7 @@
 // an SPI sub-class that provides a constructed default
  
 Adafruit_SSD1306_I2c gOled(gI2C,NC,0x78,64,128);
-Serial pc(USBTX, USBRX);
+
 
 Serial pc(USBTX, USBRX); // tx, rx
 Ticker tickerMideDistancia;
@@ -117,6 +117,10 @@
         
     //}
     contador++;
+    gOled.clearDisplay();
+    gOled.printf("piezas transportadas %d\n",contador);
+    gOled.display();
+        gOled.setTextCursor(0,0);
 }
 
 int main()
@@ -124,11 +128,14 @@
     pc.baud(115200);
     tickerMideDistancia.attach(&mideDistancia, 0.5);
     estado=cerrada;
-    
+     gOled.begin();
+    gOled.clearDisplay();
+     gOled.printf("Hola\n");
     //pc.printf("Estado cerrada\n");
     
     while(1) {
         distancia=usensor.get_dist_cm();
+        
         switch ( estado ) {
             case cerrada:
                 estadoCerrada();