Giter VIP home page Giter VIP logo

Comments (9)

n0xy1 avatar n0xy1 commented on May 30, 2024

Any chance of code to fix this?
I wanna input a variable at the end of the text, so it appears like this:

system temp:
20*C

But! the cursor pos doesn't shift. and I cant figure out a way to get the variable into the original string, i.e:
"System Temp:\n <VARIABLE HERE"

from adafruit_circuitpython_charlcd.

ladyada avatar ladyada commented on May 30, 2024

you can subscibe to this issue to be notified when it'll be added, but its jsut a placeholder for now, we don't have an ETA when we'll get to it. if you figure out how, submit a pull request and we'll check it out :)

from adafruit_circuitpython_charlcd.

tannewt avatar tannewt commented on May 30, 2024

@n0xy1 Would Python string formatting help? https://pyformat.info/

from adafruit_circuitpython_charlcd.

TheHWcave avatar TheHWcave commented on May 30, 2024

I definitely support having a 2nd message function that doesn't touch the current cursor position. Alternatively an additional boolean parameter in the original function could be used to turn the current behaviour off. That parameter could be defaulted to the current behaviour so no existing code would break.
in the mean time and in response to n0xy1, here is my work-around. Just define our own message function like that (yeah, i know one isn't supposed to call "_names" but in a crunch what can you do)?

def Kludge(col,row,txt):
lcd.cursor_position(col,row)
for c in txt:
lcd._write8(ord(c),True)

use like this to write the string "hello" starting from the 4th char position on row 2 without touching anything else already displayed:

Kludge(3,1,'hello')

from adafruit_circuitpython_charlcd.

profbrady avatar profbrady commented on May 30, 2024

Any movement on this? Last year for a class I run in the spring I was able to have students use the library to display text on two lines of a 16x2 lcd at any position by using .set_cursor(). Now that it is .cursor_position() it does not work. It seems that the message command ignores that position set by .cursor_position().

from adafruit_circuitpython_charlcd.

profbrady avatar profbrady commented on May 30, 2024

I just created a request to make a change that seems to fix this issue. I tested it with my assignment from last year and it worked.

from adafruit_circuitpython_charlcd.

profbrady avatar profbrady commented on May 30, 2024

My request was just approved. It is referred to as column_align, but it also makes cursor_position work for the next message before resetting to 0,0.

from adafruit_circuitpython_charlcd.

makermelissa avatar makermelissa commented on May 30, 2024

I just updated the release notes to include that @profbrady.

from adafruit_circuitpython_charlcd.

kattni avatar kattni commented on May 30, 2024

Fixed by #37

from adafruit_circuitpython_charlcd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.