Skip to content

Commit fb18b05

Browse files
author
funnygeeker
committed
添加 back_light 函数
1 parent b1ace28 commit fb18b05

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

drivers/ssd1306_buf.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,15 @@ def show(self):
101101
self.write_cmd(self.pages - 1)
102102
self.write_data(self.buffer)
103103

104+
def back_light(self, value):
105+
"""
106+
背光调节
107+
108+
Args:
109+
value: 背光等级 0 ~ 255
110+
"""
111+
self.contrast(value)
112+
104113

105114
class SSD1306_I2C(SSD1306):
106115
def __init__(self, width, height, i2c, addr=0x3C, external_vcc=False):

0 commit comments

Comments
 (0)