使用1602转接板需要先开启IICsudo raspi-config选择第五个 进去后选择I2C然后点是查看自己的I2C地址ls /dev/i2c-*可能会返回/dev/i2c-1记住这个1sudo i2cdetect -y 1如果说找不到命令,就需要安装I2C-toolssudo apt-get install i2c-tools python-smbus记录一下地址在一个目录下写如LCD1602的包#!/usr/bin/env python import time import smbus BUS = smbus.SMBus(1) def write_word(addr, data): global BLEN temp = data if BLEN == 1: temp |= 0x08 else: temp &= 0xF7 BUS.write_byte(addr ,temp) def send_command(comm): # Send bit7-4 firstly buf = co
一只胖橘