I am relatively fresh to NodeMcu and the Lua syntax and have a question rearding use of the builtin U8G library in firmware v0.95.
I am currently struggling getting an i2c oled display to work with nodemcu. The display I am trying to use is a cheap 0.96" oled module bought on eBay, the model with adresses 0x78 or 0x7A (with "www.heltec.cn" on the back).
Unfortunately all the efforts has failed so far. I have been using the exact same display with an Arduino, and there it had a quirk that I wonder if it is possible to cope with on the NodeMcu as well. The display is apparently not sending any acknowledges when it is configured, so in Arduino I had to use a special parameter in the constructor
U8G_I2C_OPT_NO_ACK which I can also find in the source code u8G for the NodeMcu firmware. This seems to ba possible to set in a method called u8g_i2c_init() referenced in u8g.h, but how can I call this method in a lua script?
I have tried to use the following code derived from others that have made other oleds work:
function init_i2c_display()
-- SDA and SCL can be assigned freely to available GPIOs
sda = 5 -- GPIO14
scl = 6 -- GPIO12
sla = 0x78 --default address
i2c.setup(0, sda, scl, i2c.SLOW)
disp = u8g.ssd1306_128x64_i2c(sla)
end
but this does not seem to get initialize my display correctly.. Any help appriciated
thanks, Henrik