summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2022-06-04 18:25:39 +0200
committerDaniel Friesel <derf@finalrewind.org>2022-06-04 18:25:39 +0200
commit31bc72e0ef77553ed28aca1e6ba8207d0ccec75b (patch)
treeb868d0688ffd87eda69a7688fda2dd183f8cebaa
parent7a78aa58004896a45ba825e56e846fbd32a6fa0a (diff)
ssd1306: add contrast control
-rw-r--r--ssd1306.lua7
1 files changed, 7 insertions, 0 deletions
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