Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

how to clear oled display in micropython

I’m doing this on esp8266 with micro python and there is a way to clear OLED display in Arduino but I don’t know how to clear display in micropython i used ssd1306 library to control my OLED

and this is my error I’ve written a code that prints on OLED from a list loop, but OLED prints it on the text that was printed before it (print one on top of the other not clear and printing) 7enter image description here

display = [ip, request_uri, country, region, city]

for real_time in display:
  oled.text(real_time, 0, 20)
  oled.show()
  time.sleep(2)
  print(real_time)

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

The fill() method is used to clean the OLED screen:

oled.fill(0)
oled.show()
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading