As the title says... Chat on...

User avatar
By Toshi Bass
#11802 On ESP-01 is it possible to switch the RX and TX pins off in software once the module has booted and use them as i2c SDA and SCL instead , if anyone has some example LUA code for that, please post it thanks.
User avatar
By Nic Roche
#37337 Okay verified.

No abort mechanism so you may not be able to use Esplorer etc. once in init.lau.

My steps:

Create above circuit - +ve & -ve to 3.3V breadboard power supply.

Using a ssd1306_128x64_i2c:
+ve & -ve to 3.3V breadboard power supply
SDA to circuit SDA line
SCL to circuit SCL line

Use this code (slightly modified from TJ I think):

function init_OLED(sda,scl) --Set up the u8glib lib
sla = 0x3C
i2c.setup(0, sda, scl, i2c.SLOW)
disp = u8g.ssd1306_128x64_i2c(sla)
disp:setFont(u8g.font_6x10)
disp:setFontRefHeightExtendedText()
disp:setDefaultForegroundColor()
disp:setFontPosTop()
--disp:setRot180() -- use it for rotate display
end

function print_OLED()
disp:firstPage()
repeat
PrintText()
disp:drawCircle(64, 47, 14)
disp:drawFrame(2,2,126,62)
until disp:nextPage() == false
end

str1="ESP8266-Projects.com"
str2="Hello World!!"
init_OLED(10,9) -- tx/rx
print_OLED()

Thanks to Matthew Ford for patience and unsurpassed support...