Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed Adafruit_GFX
Revision 9:d651ed116942, committed 2021-12-14
- 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();