Skip to content

Instantly share code, notes, and snippets.

View c0deaddict's full-sized avatar

Jos van Bakel c0deaddict

View GitHub Profile
@c0deaddict
c0deaddict / hd44780.lua
Created November 13, 2015 21:22
NodeMCU HD44780
local bor, band, bnot = bit.bor, bit.band, bit.bnot
local function write4bits(self, bits, char_mode)
tmr.delay(1000)
gpio.write(self.pin_rs, char_mode and gpio.HIGH or gpio.LOW)
for n = 1, 2 do
for i, pin in ipairs(self.pin_db) do
local j = (2-n)*4 + (i-1)
local val = (bit.isset(bits, j))