Raspberry Pi - Display and Output
You want to continuously display live temperature readings from a sensor on an OLED screen using Python. Which approach correctly updates the display every second without flickering?
What is the best improvement to reduce flicker?
import time
while True:
temp = read_sensor()
image = Image.new('1', (disp.width, disp.height))
draw = ImageDraw.Draw(image)
draw.text((0, 0), f'Temp: {temp}C', font=font, fill=255)
disp.image(image)
disp.display()
time.sleep(1)What is the best improvement to reduce flicker?
