2

I have been using an online tutorial, https://www.youtube.com/watch?v=B8Kr_3xHjqE&t=166s, to display text on a LCD. The LCD can do all the functions except the displaying of text. I know there is a similar issue like this but on the Zero, but this is a microcontroller, not a minicomputer. But, how am I supposed to display the text? Please write your answer in simple beginner terms and explain deeply, as I just got my Pico a few days ago and am completely new to it.

The code for displaying the text:

def test_main(): #Test function for verifying basic functionality print("Running test_main") i2c = I2C(0, sda=machine.Pin(0), scl=machine.Pin(1), freq=400000) lcd = I2cLcd(i2c, I2C_ADDR, I2C_NUM_ROWS, I2C_NUM_COLS) print("Attempting to print It works") lcd.putstr("It Works!") utime.sleep(2) lcd.clear() count = 0 while True: lcd.clear() time = utime.localtime() lcd.putstr("{year:>04d}/{month:>02d}/{day:>02d} {HH:>02d}:{MM:>02d}:{SS:>02d}".format( year=time[0], month=time[1], day=time[2], HH=time[3], MM=time[4], SS=time[5])) if count % 10 == 0: print("Turning cursor on") lcd.show_cursor() if count % 10 == 1: print("Turning cursor off") lcd.hide_cursor() if count % 10 == 2: print("Turning blink cursor on") lcd.blink_cursor_on() if count % 10 == 3: print("Turning blink cursor off") lcd.blink_cursor_off() if count % 10 == 4: print("Turning backlight off") lcd.backlight_off() if count % 10 == 5: print("Turning backlight on") lcd.backlight_on() if count % 10 == 6: print("Turning display off") lcd.display_off() if count % 10 == 7: print("Turning display on") lcd.display_on() if count % 10 == 8: print("Filling display") lcd.clear() string = "" for x in range(32, 32+I2C_NUM_ROWS*I2C_NUM_COLS): string += chr(x) lcd.putstr(string) count += 1 utime.sleep(2)

#if name == "main": test_main()

And, please give your answer in simple words. Thanks!

Schematic:

How I wired it up

I believe the problem has to do with contrast

1
  • the question should stand on its own without the need to access an external link, which may become invalid ... please add all information to your question
    – jsotola
    Commented Jan 6, 2023 at 6:56

1 Answer 1

0

All I needed to do was to scew the pentiometer. Thanks anyway for trying to help me! :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.