We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3944eaf commit 3cd02e1Copy full SHA for 3cd02e1
1 file changed
Pi_Hole_Ad_Blocker/stats.py
@@ -48,6 +48,11 @@
48
# Create the I2C interface.
49
i2c = busio.I2C(SCL, SDA)
50
51
+# Blanks the Pi OLED display.
52
+def blank_screen(display):
53
+ display.fill(0)
54
+ display.show()
55
+
56
# Create the SSD1306 OLED class.
57
# The first two parameters are the pixel width and pixel height. Change these
58
# to the right size for your display!
@@ -59,8 +64,7 @@
59
64
DISPLAY_OFF = 50 # off time in seconds
60
65
61
66
# Clear display.
62
-disp.fill(0)
63
-disp.show()
67
+blank_screen(disp)
68
69
# Create blank image for drawing.
70
# Make sure to create image with mode '1' for 1-bit color.
@@ -132,6 +136,6 @@
132
136
disp.image(image)
133
137
disp.show()
134
138
time.sleep(DISPLAY_ON)
135
- disp.fill(0)
- disp.show()
139
+ # Clear display.
140
+ blank_screen(disp)
141
time.sleep(DISPLAY_OFF)
0 commit comments