This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)) |
NewerOlder