From 31bc72e0ef77553ed28aca1e6ba8207d0ccec75b Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sat, 4 Jun 2022 18:25:39 +0200 Subject: ssd1306: add contrast control --- ssd1306.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ssd1306.lua b/ssd1306.lua index 812459b..2ab3491 100644 --- a/ssd1306.lua +++ b/ssd1306.lua @@ -46,6 +46,13 @@ function ssd1306.init(width, height) end end +function ssd1306.contrast(contrast) + local tab = {s_CONTRAST, contrast} + for i, v in ipairs(tab) do + ssd1306.wc(v) + end +end + function ssd1306.show(fb) local txbuf = {0x40} for i = 1, ssd1306.w * ssd1306.h / 8, 128 do -- cgit v1.2.3