![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Código sensor para material particulado con PMS 5003
Diff: main.cpp
- Revision:
- 2:e80f510b3cb2
- Parent:
- 1:5bc605d2b8f8
- Child:
- 3:4c7554fd88a5
--- 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));