Hello, got a rather basic noob question.
I am using the particle oled display featherwing with the code below to cycle through the display of several sensor data points. This is my loop.
I read somewhere that too many delays in the loop can can cause issues with cloud connectivity? ( blocking ?).
Is what I have the best way to do this? With several delays between the display? Is there a better way to set this up?
oled.clearDisplay();
oled.setTextSize(1);
oled.setTextColor(WHITE);
oled.setCursor(0, 0);
oled.clearDisplay();
oled.setCursor(0, 0);
oled.print("Time: ");
oled.setCursor(0, 20);
Time.zone(-5);
oled.println(Time.format(Time.now(), "%a %b, %e %l:%M %p"));
oled.display();
delay(4000);
oled.clearDisplay();
oled.setCursor(0, 0);
oled.print("Temp/Humidity: ");
oled.setCursor(0, 20);
snprintf(buf, sizeof(buf), "%.1f ", tempF); // temperature
oled.print("Temp "); oled.println(buf);
oled.setCursor(67, 20);
snprintf(buf, sizeof(buf), "%.1f ", sample.humidity); // humidity
oled.print("RH "); oled.println(buf);
oled.display();
delay(4000);
oled.clearDisplay();
oled.setCursor(0, 0);
oled.print("Gases: ");
oled.setCursor(0, 20);
snprintf(buf, sizeof(buf), "%.1f ", sample.co2); // CO2
oled.print("CO2 "); oled.println(buf);
oled.setCursor(67, 20);
snprintf(buf, sizeof(buf), "%.1f ", sample.voc); // VOC
oled.print("VOC "); oled.println(buf);
oled.display();
delay(4000);
oled.clearDisplay();
oled.setCursor(0, 0);
oled.print("Dust Levels: ");
oled.setCursor(0, 20);
snprintf(buf, sizeof(buf), "%.1f ", sample.MassPM2); // PM2.5
oled.print("PM2.5 "); oled.println(buf);
oled.setCursor(67, 20);
snprintf(buf, sizeof(buf), "%.1f ", sample.MassPM10); // PM10
oled.print("PM10 "); oled.println(buf);
oled.display();
delay(4000);