I have problems with a 2x16 LCD Display controlled via I2C. I use python 2.7 and have a Raspberry Pi Zero W. When called from the main loop everything works fine and I can access the display with
my_lcd.lcd_display_string("test", 1 , 0)
without problems. But when I call the same with a procedure called by interrupt I just get garbage on the LCD and everything is messed up.
The source code is like that
GPIO.setup(TasteHoch, GPIO.IN) def SWH( pin ): global my_lcd my_lcd.lcd_display_string("test", 1 , 0) my_lcd = I2C_LCD_driver.lcd() GPIO.add_event_detect(TasteHoch, GPIO.FALLING, callback=SWH, bouncetime = 200)
The interrupt pin is wired (pull-up with capacitor bebouncing) to a breadboard push button, there are no other interrupts involved. As I checked the interrupt routine is only triggered once per push.