stuff
This commit is contained in:
parent
04102e8d93
commit
e9917ce33d
1 changed files with 4 additions and 3 deletions
7
LCD.py
7
LCD.py
|
|
@ -1,5 +1,6 @@
|
||||||
import asyncio
|
import asyncio
|
||||||
import smbus
|
import smbus
|
||||||
|
import time
|
||||||
|
|
||||||
lock = asyncio.Lock()
|
lock = asyncio.Lock()
|
||||||
|
|
||||||
|
|
@ -66,11 +67,11 @@ class LCD:
|
||||||
self.toggle_enable(bits_low)
|
self.toggle_enable(bits_low)
|
||||||
|
|
||||||
def toggle_enable(self, bits):
|
def toggle_enable(self, bits):
|
||||||
asyncio.sleep(self.E_DELAY)
|
time.sleep(self.E_DELAY)
|
||||||
self.bus.write_byte(self.I2C_ADDR, (bits | self.ENABLE))
|
self.bus.write_byte(self.I2C_ADDR, (bits | self.ENABLE))
|
||||||
asyncio.sleep(self.E_PULSE)
|
time.sleep(self.E_PULSE)
|
||||||
self.bus.write_byte(self.I2C_ADDR,(bits & ~self.ENABLE))
|
self.bus.write_byte(self.I2C_ADDR,(bits & ~self.ENABLE))
|
||||||
asyncio.sleep(self.E_DELAY)
|
time.sleep(self.E_DELAY)
|
||||||
|
|
||||||
async def async_message(self, string, line = 1):
|
async def async_message(self, string, line = 1):
|
||||||
async with lock:
|
async with lock:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue