Refresh problem eInk featherwing/circuitPython

CircuitPython on hardware including Adafruit's boards, and CircuitPython libraries using Blinka on host computers.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
artman70
 
Posts: 20
Joined: Tue Nov 29, 2016 8:44 am

Refresh problem eInk featherwing/circuitPython

Post by artman70 »

I have a featherS2 and a 2.9 grayscale featherwing.. i use the following code to set some text..

Code: Select all

import time
import busio
import board
import displayio
import terminalio
import adafruit_il0373
from adafruit_display_text import label

displayio.release_displays()

spi = busio.SPI(board.SCK, board.MOSI)
epd_cs = board.IO1
epd_dc = board.IO3

display_bus = displayio.FourWire(
    spi, command=epd_dc, chip_select=epd_cs, baudrate=1000000
)
time.sleep(1)

display = adafruit_il0373.IL0373(
    display_bus,
    width=296,
    height=128,
    rotation=270,
    black_bits_inverted=True,
    color_bits_inverted=True,
    grayscale=True,
    refresh_time=1,
)

sampleTxt = "THIS IS A TEST"
textBox = label.Label(terminalio.FONT, text=sampleTxt, x=100,y=50, color=0xFFFFFF)
display.show(textBox)
display.refresh()
time.sleep(20)
textBox.text = "Testing Testing Testing"
display.show(textBox)
display.refresh()
time.sleep(1)

the first text prints fine
but the second text input never prints on the display
im sure im using label wrong or refresh wrong but cant see how..
thank you for the help!!!

User avatar
alpierce
 
Posts: 206
Joined: Mon May 13, 2013 2:44 am

Re: Refresh problem eInk featherwing/circuitPython

Post by alpierce »

If you are wishing to display different text in multiple areas of the display
Try adding a display group like:

screen = displayio.Group()
display.show(screen)

create the text areas:

fail_text = "PF 11/24/21 23:50:30"
fail_text_area = bitmap_label.Label(terminalio.FONT, text=fail_text, scale = 2, color=color )
fail_text_area.x = 5
fail_text_area.y = 30

restore_text = "PR 11/24/21 23:56:20"
restore_text_area = bitmap_label.Label(terminalio.FONT, text=restore_text, scale = 2, color=color )
restore_text_area.x = 5
restore_text_area.y = 60

duration_text = "PD 23Hrs 23Min 56Sec"
duration_text_area = bitmap_label.Label(terminalio.FONT, text=duration_text, scale = 2, color=color )
duration_text_area.x = 5
duration_text_area.y = 90

then append the text areas, show and refresh:

screen.append(fail_text_area)
screen.append(restore_text_area)
screen.append(duration_text_area)

display.show(screen)

display.refresh()

Locked
Please be positive and constructive with your questions and comments.

Return to “Adafruit CircuitPython”