Comments (5)
I wrote this library for a single project a long time ago. Now I work for Adafruit slightly_smiling_face, and I'll regularize the constructor. The normal thing we do now is to have you pass in an
I2C
object to the constructor.
Now that you work at adafruit, any news if PCF8574 will be supported in the official adafruit cricuitpython libraries for i2c displays?
from circuitpython_lcd.
I wrote this library for a single project a long time ago. Now I work for Adafruit 🙂, and I'll regularize the constructor. The normal thing we do now is to have you pass in an I2C
object to the constructor.
from circuitpython_lcd.
Changed but not tested:
- default branch is now
main
, so pull and checkoutmain
instead ofmaster
, or re-clone. - Now you must pass in the
I2C
object to the constructor, e.g.:
i2c = busio.i2c(scl=board.GP1, sda=board.GP0)
interface = I2CPCF8574Interface(i2c, i2c_address)
...
I think I've fixed the brightness
issue also, but try it.
Most of my work on this has been on the minimal
branch, which removes a number of features to save space. That was when I was trying to get this to fit on a Feather M0.
from circuitpython_lcd.
import board,busio
from lcd.lcd import LCD
from lcd.i2c_pcf8574_interface import I2CPCF8574Interface
from lcd.lcd import CursorMode
i2c = busio.i2c(scl=board.GP1, sda=board.GP0)
interface = I2CPCF8574Interface(i2c, i2c_address)
lcd.print("abc ")
lcd.print("This is quite long and will wrap onto the next line automatically.")
lcd.clear()
# Start at the second line, fifth column (numbering from zero).
lcd.set_cursor_pos(1, 4)
lcd.print("Here I am")
# Make the cursor visible as a line.
lcd.set_cursor_mode(CursorMode.LINE)
my code this is giving me an error
soft reboot
Traceback (most recent call last):
File "<stdin>", line 7, in <module>
AttributeError: 'module' object has no attribute 'i2c'
from circuitpython_lcd.
It should be busio.I2C
, all caps.
from circuitpython_lcd.
Related Issues (8)
- /lib/lcd/lcd.py: IndexError: index out of range
- Running lcd.clear() gives random chars HOT 4
- time.sleep not accurate, i2c writes not working on ARM M4 HOT 2
- Add #import microcontroller to i2c_pcf8574.py HOT 2
- backlight control doesn't work HOT 1
- Custom characters not working HOT 2
- Unable to lcd.print variables HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from circuitpython_lcd.