Python Forum
Writing on an lcd display gives problems to the program
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Writing on an lcd display gives problems to the program
#1
I am using Python on the Raspberry pi 4 model B to count the number of times that a button, connected to a GPIO pin of the pi, is pressed. My code is working just fine for that, even by pressing the button several times per second. Then I connected to the Raspberry pi an I2C lcd 20x4 display so that I can read on it some data on real time. For the counting part I used a while-loop and since the variables that I want to have on the display are changing at each loop-iteration, the commands to print on the display (display.lcd_display_string) need to be inside the while-loop. I can display the data that I want correctly and everything works fine if only one of the four variables I need is displayed on the display. However, if I want to display two or more different variables at the same time (on different lines), the entire program appears to run way slower and the counting part is not working well anymore, not detecting all the times that the button is pressed, especially if the rate of the button-push is high (a lot of pushes in a second). Does anyone know why the program works well if only one line is displayed on the lcd and it doesn't when more than one line is displayed?
Reply
#2
see the post by DougieLawson here.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Writing to CSV Problems gbtur8up 1 543 Oct-18-2023, 10:20 AM
Last Post: Larz60+
  add svg to 2 thread program and display tabel in GUI Nietzsche 5 1,424 May-06-2023, 01:25 PM
Last Post: Nietzsche
  How to display <IPython.core.display.HTML object>? pythopen 3 45,970 May-06-2023, 08:14 AM
Last Post: pramod08728
  I am writing a car rental program on python. In this function I am trying to modify aboo 2 2,745 Aug-05-2021, 06:00 PM
Last Post: deanhystad
Information Unable to display joystick's value from Python onto display box MelfoyGray 2 2,238 Nov-11-2020, 02:23 AM
Last Post: MelfoyGray
  Program writing excel rfile with randomnized input wepkes 1 3,684 Dec-08-2016, 08:06 PM
Last Post: nilamo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020