Black Lives Matter - Action and Equality. ... Adafruit is open and shipping.
0

cursor_position
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

cursor_position

by MJG300 on Fri Jun 28, 2019 1:47 am

Hi Everyone,
I have been messing with my LCD Backpack with a 20 x 4 lcd mono screen. I would like to display items in a neat and orderly fashion, but I am having trouble displaying items at a specific spot on the screen. Could anyone give me good examples of these displays in python?

Thanks to everyone in advance, this has been frustrating for me.

Mark

MJG300
 
Posts: 4
Joined: Wed Aug 03, 2016 11:12 am

Re: cursor_position

by adafruit_support_mike on Sun Jun 30, 2019 3:14 am

The documentation here has the most information:

https://circuitpython.readthedocs.io/pr ... tion-notes

The function you want is cursor_position():

https://circuitpython.readthedocs.io/pr ... r_position

adafruit_support_mike
 
Posts: 61206
Joined: Thu Feb 11, 2010 2:51 pm

Re: cursor_position

by MJG300 on Sun Jun 30, 2019 1:19 pm

I have seen this documentation before, but I get the same results. The second message still gets displayed at the home position (1,1).
Here is a test program that I created to help me learn more about it.
Thank you for the response, I do appreciate it.

Code: Select all | TOGGLE FULL SIZE
import time
import board
import busio
import adafruit_character_lcd.character_lcd_i2c as character_lcd

lcd_col = 20
lcd_row = 4

i2c = busio.I2C(board.SCL, board.SDA)

lcd = character_lcd.Character_LCD_I2C(i2c, lcd_col, lcd_row)

lcd.backlight = True
lcd.home()

lcd.message ="Hello!"

time.sleep(1)

lcd.clear()

time.sleep(1)

lcd.cursor_position (2,0)
lcd.message="Hello2!"

time.sleep(2)
Last edited by adafruit_support_mike on Mon Jul 01, 2019 1:09 am, edited 1 time in total.
Reason: added CODE tags

MJG300
 
Posts: 4
Joined: Wed Aug 03, 2016 11:12 am

Re: cursor_position

by MJG300 on Thu Jul 04, 2019 11:50 am

Update...
Can not find any clear examples of the cursor_position for Adafruit LCD anywhere on the internet, just ALOT of documentation about it.
Can anyone give a good working example of this?

Thank You

MJG300
 
Posts: 4
Joined: Wed Aug 03, 2016 11:12 am

Re: cursor_position

by MJG300 on Sun Jul 07, 2019 12:30 am

According to GitHub, This is a known problem. Adafruit_Circuitpython_CharLCD cursor_position does not like Python 3.

MJG300
 
Posts: 4
Joined: Wed Aug 03, 2016 11:12 am

Re: cursor_position

by adafruit_support_mike on Sun Jul 07, 2019 2:06 am

We have some people looking at the code. They'll commit an update when they know what's going wrong.

adafruit_support_mike
 
Posts: 61206
Joined: Thu Feb 11, 2010 2:51 pm

Re: cursor_position

by adafruit_support_carter on Tue Jul 09, 2019 10:00 am

According to GitHub, This is a known problem. Adafruit_Circuitpython_CharLCD cursor_position does not like Python 3.

@MJG300 Is there an issue for this, or can you link to where you are finding this info? I'm not seeing one specific to this here:
https://github.com/adafruit/Adafruit_Ci ... LCD/issues

adafruit_support_carter
 
Posts: 16367
Joined: Tue Nov 29, 2016 2:45 pm

Re: cursor_position

by adafruit_support_carter on Thu Jul 11, 2019 12:31 pm

I can't recreate this issue. I ran your test program above and it printed at the expected location:
lcd_test.jpg
lcd_test.jpg (68.26 KiB) Viewed 78 times


Are you using the latest CircuitPython firmware and Library Bundle release?

adafruit_support_carter
 
Posts: 16367
Joined: Tue Nov 29, 2016 2:45 pm

Please be positive and constructive with your questions and comments.