From 54677d0a0ef957669b735424fe35c5132b1de20e Mon Sep 17 00:00:00 2001 From: mareksaw-cg <82727321+mareksaw-cg@users.noreply.github.com> Date: Mon, 19 Apr 2021 07:46:52 +0200 Subject: [PATCH] Update ssd1309.py Added contrast level adjustment. --- ssd1309.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ssd1309.py b/ssd1309.py index fdbf32e..ed76fb3 100644 --- a/ssd1309.py +++ b/ssd1309.py @@ -132,6 +132,14 @@ def clear_buffers(self): """Clear buffer. """ self.monoFB.fill(0x00) + + + def contrast(self, contrast): + """Set contrast level 0 to 255 + """ + self.write_cmd(CONTRAST_CONTROL) + self.write_cmd(contrast) + def draw_bitmap(self, path, x, y, w, h, invert=False, rotate=0): """Load MONO_HMSB bitmap from disc and draw to screen.