shaoziyang / microbit-lib

all kinds of microbit python drives, libs, examples, etc.
MIT License
48 stars 39 forks source link

test.py Error on the Mu with a invalid syntax for the "1.puts" #5

Closed lovingdogji closed 5 years ago

lovingdogji commented 5 years ago

When I copy your text.py on the Mu, it shows invalid syntax for the "1.puts(XXX)". How to correct it....

shaoziyang commented 5 years ago

There are some test.py files in the repository, which file causing the error?

MicroPython firmware version has been upgrade to 1.9.2, some files may need to be upgraded too.

lovingdogji commented 5 years ago

It is microbit-lib/lcd/I2C_LCD1602/test.py. I had copy the code on the Mu when check it ,it shows invalid syntax for the "1.puts(XXX)".

手头上买了个i2c_1602的LCD屏,昨天在电子工程世界的论坛里搜到《microbit的I2C 1602液晶驱动》,里面python部分的网址导向这边。用里面test.py的程序拷贝到Mu下,刷入的时候Microbit显示 invalid syntax,用Mu自带的检查功能, 1 = LCD1620() 1.puts(“Hello microbit!”) 提示是“1.puts”处有下划线,显示“语法错误,Python 无法理解这一行。检查缺少的字符!”

shaoziyang commented 5 years ago

please check your LCD1602 address, the address of I2C maybe 0x27 or 0x3F, depend on your module.