在覆盆子上,我使用 Adafruit CharLCD 收到此消息:我不明白为什么它谈论必须是字符串的参数..
Traceback (most recent call last):
File "./lcd.py", line 52, in <module>
main()
File "./lcd.py", line 39, in main
lcd = LCD.Adafruit_CharLCD(lcd_rs, lcd_en, lcd_d4, lcd_d5, lcd_d6, lcd_d7, lcd_columns, lcd_rows, lcd_backlight)
File "build/bdist.linux-armv7l/egg/Adafruit_CharLCD/Adafruit_CharLCD.py", line 143, in __init__
File "build/bdist.linux-armv7l/egg/Adafruit_GPIO/GPIO.py", line 278, in setup
TypeError: argument 1 must be string, not int
这是我的代码:
#LCD variables
lcd_rs= 18
lcd_en= 23
lcd_d4= 12
lcd_d5= 16
lcd_d6= 20
lcd_d7= 21
lcd_backlight= 4
lcd_columns= 16
lcd_rows= 2
lcd = LCD.Adafruit_CharLCD(lcd_rs, lcd_en, lcd_d4, lcd_d5, lcd_d6, lcd_d7, lcd_columns, lcd_rows, lcd_backlight)
lcd.message('Humidite %s' %(humidity))