Add new comment

Hello World

Submitted by Erik Wegner on
Aufmacherbild

Der folgende Code schreibt einen Text auf ein OLED-Display:

sda = 2
scl = 1
i2c.setup(0, sda, scl, i2c.SLOW)
sla = 0x3c
disp = u8g.sh1106_128x64_i2c(sla)
tmr.create():alarm(1000, tmr.ALARM_AUTO, function() 
uart.write(0, "timer\n")
disp:firstPage()
repeat
    disp:setFont(u8g.font_6x10)
    disp:setFontRefHeightExtendedText()
    disp:setDefaultForegroundColor()
    disp:setFontPosTop()
    disp:drawStr( 0, 20, "Hello World!");
until disp:nextPage() == false     
end)

Erforderlich in der Firmware sind die Module: i2c, u8g, tmr, uart

Associated categories
CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.