Porgrama PMS5003 pantalla LCD K64F

Dependencies:   DmTftLibrary

Files at this revision

API Documentation at this revision

Comitter:
sebastianrestrepo
Date:
Thu Oct 28 22:24:20 2021 +0000
Parent:
1:5bc605d2b8f8
Commit message:
Programa para sensor PMS5003 utilizando K64F con display en tarjeta LCD

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 5bc605d2b8f8 -r e80f510b3cb2 main.cpp
--- a/main.cpp	Thu Oct 28 21:55:43 2021 +0000
+++ b/main.cpp	Thu Oct 28 22:24:20 2021 +0000
@@ -40,6 +40,7 @@
 /******************************************************************************
  * Global variables
  *****************************************************************************/
+uint16_t pm = 0;
 
 /******************************************************************************
  * Local functions
@@ -51,6 +52,8 @@
     printf("Concentration Units (standard)\n");
     printf("PM 1.0: %u", data.pm10_standard);
     printf("\t\tPM 2.5: %u", data.pm25_standard);
+    tft.drawString(70, 100, "PM 2.5:");
+    tft.drawNumber(150, 100, data.pm25_standard, 2, false);
     printf("\t\tPM 10: %u\n", data.pm100_standard);
     printf("---------------------------------------\n");
     printf("Concentration Units (environmental)\n");
@@ -77,19 +80,19 @@
 int main() {
     //printf("Bienvenido");
     log("init tft \r\n");
-  tft.init();
-  
-//  uint16_t x = 0;
-//  uint16_t y = 0;
-  uint16_t w = tft.width();
-  uint16_t h = tft.height();
+    tft.init();
+    
+    //  uint16_t x = 0;
+    //  uint16_t y = 0;
+    uint16_t w = tft.width();
+    uint16_t h = tft.height();
   
-//  bool down = false;
-//  bool lastDown = false;
-  tft.setTextColor(0xFFFF,0xF81F);
-  tft.drawString(35, 30, "Cantidad de particulas :(  ");
-  tft.drawString(70, 100, "Pm 2.5: ");
-  tft.drawString(70, 150, "Pm 1.0: ");
+    //  bool down = false;
+    //  bool lastDown = false;
+    tft.setTextColor(0xFFFF,0xF81F);
+    tft.drawString(35, 30, "Cantidad de particulas : ");
+    //tft.drawString(70, 100, "Pm 2.5: ");
+    tft.drawString(70, 150, "Pm 1.0: ");
 
     // This callback runs in an interrupt context, thus we debounce to the event queue here
     pm25.enable(queue.event(&pm25_data_callback));