Cursor position (0, 20) invalid on a 4x20 LCD
See original GitHub issueWhen initializing an LCD with “auto_linebreaks=False”, then writing a 20 character string to position (0, 0)
seems to fail.
Traceback (most recent call last):
File "/usr/local/bin/lcd.py", line 60, in <module>
main(controller, addr, cols, rows)
File "/usr/local/bin/lcd.py", line 28, in main
loop(lcd, unit)
File "/usr/local/bin/lcd.py", line 48, in loop
lcd.write_string(datestring.ljust(lcd.lcd.cols))
File "/usr/local/lib/python3.5/dist-packages/RPLCD/lcd.py", line 279, in write_string
self.write(char)
File "/usr/local/lib/python3.5/dist-packages/RPLCD/lcd.py", line 406, in write
self.cursor_pos = newpos
File "/usr/local/lib/python3.5/dist-packages/RPLCD/lcd.py", line 151, in _set_cursor_pos
raise ValueError(msg.format(pos=value, lcd=self.lcd))
ValueError: Cursor position (0, 20) invalid on a 4x20 LCD.
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Using a 4x20 LCD with Arduino - Interfacing
Here I am back, trying to test my new setup of Arduino using a 4x20 LCD as output. The idea is to monitor...
Read more >facing problem to display number on lcd - Keil forum
Hi, i am working on 4X20 LCD ....i wrote code for that this code is working but when trying to reset my board...
Read more >View topic - LCD truble!!! is not possible but
I have a problem whit a 4x20 LCD Display whit ks0073 controller . ... what is wrong? ... To set the cursor at...
Read more >Moving cursor to lower line on LCD
I FINALLY have the XLCD library working with a 4x20 LCD. I used the PutrsXLCD function to write a string to the first...
Read more >Why won't the 3rd line of my 4x20 LCD work? It just ... - Quora
Hello, yes I have had a similar problem with the line numbers on 4x20 LCD displays. ... WriteLCDCommand( 0x80 ); // Sets cursor...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m not sure. My preferred solution would be to simply continue writing to the memory. If you turn off auto linebreaks, then you’re on your own and any logic should be disabled.
This means that we’d have to disable bounds checks in that case.
Anything new when this issue will be fixed in the official release you install with pip? Even resetting the Cursorposition doesn’t help. Second write leads to an exception. Since I return the Cursorposition to the beginning, this shouldn’t happen. If you wriite “ab” in the second write, display shows “ab3456789abcdefghijk”, so moving the cursor seems to work.