question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

st7735: persist=True not honored

See original GitHub issue

Type of Raspberry Pi

RPi 3 B+ running Arch Linux Arm

Linux Kernel version

Linux alarmpi 4.19.25-2-ARCH #1 SMP PREEMPT Tue Feb 26 01:20:52 UTC 2019 armv7l GNU/Linux

Expected behavior

I have written a test program to learn how to use your libraries, test.py:

import time
import RPi.GPIO as GPIO
from luma.core.interface.serial import spi
from luma.core.render import canvas
from luma.lcd.device import st7735
from luma.lcd.aux import backlight
from PIL import ImageFont

serial = spi(port=0, device=0, gpio_DC=25, gpio_RST=27)
device = st7735(serial, width=128, height=128, h_offset=1, v_offset=2, bgr=True, persist=True)

gpio_LIGHT = 24
light = backlight(gpio=GPIO, gpio_LIGHT=gpio_LIGHT, active_low=False)

font = ImageFont.truetype("Roboto-Bold.ttf", 14)

light.enable(True)

# Box and text rendered in portrait mode
with canvas(device) as draw:
    draw.rectangle(device.bounding_box, outline="white", fill="black")
    draw.text((10, 50), "Hello World", fill="yellow", font=font)
    draw.text((10, 30), "Hello World", fill="white", font=font)

input()

light.enable(False)
time.sleep(2)

I expected that the graphics will remain on screen and backlight will turn off and stay off after python script concludes.

Actual behavior

I used persist=True in the device setup expecting that the image would stay on the screen, but it did not, the screen becomes blank white. I also tried adding a switch at the end to turn the backlight off expecting it to stay off, but again, backlight is ON and screen is white. Finally, I added a 2 second delay at the very end to be able to see if the backlight control was working. It was, but the screen turns white with the backlight ON after the script ends.

I think that the cleanup of the gpio pins, turning them to tri-state inputs, causes the active high backlight to activate due to a 3.3V pullup in the circuit on the HAT, and the RESET to appear to go low, which would reset the chip.

Am I using the persist option correctly? Anything else I should try?

Thanks -Ted

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
Rippertcommented, Mar 30, 2019

I went ahead and updated everything in the list. It didn’t make a difference, which I thought would be the case looking at the commits between 1.1.0 and 1.1.1.

Thanks for pointing out the pip command. I’m just getting started in python, so it’s good to know.

0reactions
Rippertcommented, Mar 30, 2019
$ pip list --outdated
Package   Version Latest Type 
--------- ------- ------ -----
luma.lcd  1.1.0   1.1.1  wheel
luma.oled 3.1.0   3.1.1  wheel
pip       18.1    19.0.3 whee
Read more comments on GitHub >

github_iconTop Results From Across the Web

Arduino uno with TFT7735 1.8" not working (yet) - Displays
I bought a TFT st7735 1.8"display I want to hook it up to a Arduino uno. The library i found https://github.com/Bodmer/TFT_ST7735 Is there...
Read more >
Problems with ST7735 160x80 0.96" SPI Display + Teensy 3.6 ...
Hi all - Haven't been able to get a generic ST7735 160x80 0.96" SPI Display working with a T3.6 (and now a T3.5...
Read more >
The BEST Color Display For Electronics Projects? ST7735 ...
ST7735 TFT display is easy and cheap for Arduino, ESP8266, ESP32 or Raspberry Pi projects!Check out PCBWay http://pcbway.
Read more >
Arduino Tutorial: 1.8" TFT Color Display ST7735 128x160
On this tutorial I explain what you need to do to make the 1.8" 128x160 TFT color display with the ST7735 driver work...
Read more >
1.8" TFT Display Breakout and Shield - Adafruit Learning System
The TFT driver (ST7735R) can display full 18-bit color (262,144 shades!). And the LCD will always come with the same driver chip so...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found