marcmerlin / SmartMatrix_GFX

SmartMatrix::GFX: Allow using Adafruit::GFX as well as FastLED_NeoMatrix code with SmartMatrix backend,
GNU General Public License v3.0
80 stars 11 forks source link

matrix->clear(); does not work. #5

Closed GeorgeFlorian closed 5 years ago

GeorgeFlorian commented 5 years ago

Board: ESP32

I have this in void main()


          matrix->setTextColor(LED_CYAN_HIGH);
          matrix->setFont(NULL);
          matrix->setCursor(1,0);
          matrix->print("Home page");
          matrix->setCursor(0,8);
          matrix->print("found at:");
          matrix->setCursor(0,16);
          matrix->setTextWrap(true);
          matrix->setTextColor(LED_PURPLE_HIGH);
          matrix->print(IP_copy);
          matrix->show();

and this code inside void loop():

if(WiFi.status() != WL_CONNECTED) {
      matrix->clear();
      delay(1000);
      Serial.println("There is no WiFi Connection !");
    }

I am basically checking if I have a WiFi Connection. If I don't, I want the display to display nothing.

While the Serial.println() works, the matrix->clear(); does not clear the text from the display.

marcmerlin commented 5 years ago

matrix->clear() only clears the framebuffer. You still need to run matrix->show to sync the framebuffer to the display

GeorgeFlorian commented 5 years ago

You are absolutely right ! Thank you !