Mateo Jiménez Santacruz
/
Proyecto
Código sensor para material particulado con PMS 5003
Diff: main.cpp
- Revision:
- 3:4c7554fd88a5
- Parent:
- 2:e80f510b3cb2
- Child:
- 4:c8e5928f440c
diff -r e80f510b3cb2 -r 4c7554fd88a5 main.cpp --- a/main.cpp Thu Oct 28 22:24:20 2021 +0000 +++ b/main.cpp Fri Oct 29 21:57:36 2021 +0000 @@ -51,10 +51,14 @@ printf("---------------------------------------\n"); printf("Concentration Units (standard)\n"); printf("PM 1.0: %u", data.pm10_standard); + tft.drawString(70, 70, "PM 1.0:"); + tft.drawNumber(150, 70, data.pm10_standard, 5, false); 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); + tft.drawString(70, 110, "PM 2.5:"); + tft.drawNumber(150, 110, data.pm25_standard, 5, false); printf("\t\tPM 10: %u\n", data.pm100_standard); + tft.drawString(70, 150, "PM 10.0:"); + tft.drawNumber(150, 150, data.pm100_standard, 5, false); printf("---------------------------------------\n"); printf("Concentration Units (environmental)\n"); printf("PM 1.0: %u", data.pm10_env); @@ -78,21 +82,17 @@ 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(); - - // bool down = false; - // bool lastDown = false; + tft.fillRectangle(0, 0, 1000,1000, 0xFFFF); + tft.fillCircle(130, 250, 40, 0xF81F); 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));