Ai
2 Star 3 Fork 1

猴哥/esp8266-micropython

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
modular_iic1602.py 732 Bytes
一键复制 编辑 原始数据 按行查看 历史
猴哥 提交于 2021-06-16 01:24 +08:00 . 加入iic
"""Implements a HD44780 character LCD connected via PCF8574 on I2C.
This was tested with: https://www.wemos.cc/product/d1-mini.html"""
from time import sleep_ms, ticks_ms
from machine import I2C, Pin
from esp8266_i2c_lcd import I2cLcd
# The PCF8574 has a jumper selectable address: 0x20 - 0x27
DEFAULT_I2C_ADDR = 0x3f
def test_main():
"""Test function for verifying basic functionality."""
print("Running test_main")
i2c = I2C(scl=Pin(5), sda=Pin(4), freq=400000)
lcd = I2cLcd(i2c, DEFAULT_I2C_ADDR, 2, 16)
lcd.putstr("It Works!\nSecond Line")
sleep_ms(3000)
lcd.clear()
count = 0
while True:
lcd.move_to(0, 0)
lcd.putstr("%7d" % (ticks_ms() // 1000))
sleep_ms(1000)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/baozhuo/esp8266-micropython.git
git@gitee.com:baozhuo/esp8266-micropython.git
baozhuo
esp8266-micropython
esp8266-micropython
master

搜索帮助