Pulled out most of the graphics functions, finally got enough out to build/run string, as I, ascii2
Which is enough.
Thanks
Explore... Chat... Share...
local ug8_utils = {MOD_NAME = "ug8_utils"}
function ug8_utils:initI2C(sda_n, scl_n, addr_n)
self.id = 0
self.addr = addr_n
self.sda = sda_n
self.scl = scl_n
-- SDA and SCL can be assigned freely to available GPIOs
i2c.setup(self.id, self.sda, self.scl, i2c.SLOW)
self.disp = u8g.ssd1306_128x64_i2c(sla)
end
print('ug8_utils.lua - print msg')
function ug8_utils:prepare()
self.disp.setFont(u8g.font_6x10)
self.disp.setFontRefHeightExtendedText()
self.disp.setDefaultForegroundColor()
self.disp.setFontPosTop()
end
function ug8_utils:write(x,y,txt)
print("--- Starting Ug8Lib draw ---")
-- cycle through all components
self.disp.firstPage()
repeat
self.prepare()
self.disp.drawStr(x,y,txt)
until self.disp.nextPage() == false
tmr.wdclr()
print("end write func")
end
flashMod(ug8_utils)
return ug8_utils
It takes about 20-25 seconds for home assistant c[…]
I tried to upgrade tof my sonoff basic R2 with the[…]
a problem Perhaps you want to define "Probl[…]
Rebooting your router will not give you a faster I[…]
There are no other notifications from esptool.py i[…]
Using the Arduino IDE, you'll learn how to set up […]
In this project, you will post to Twitter using an[…]
In this project, we will build a water level contr[…]
I guess I'm late, but I had the same problem and f[…]
Last night I received my first D1 Minis for a lear[…]
Although I am aware that this is an old post, I fe[…]