Closed
Description
Trying to make a fancy temperature guage for an old temp chamber at work in my downtime. Picked up a Qualia RGB666 board w/ the 4" LCD from Adafruit. I'm able to generate all the necessary display elements and the temperature reading correctly updates the text box, but I can't get the arc of the guage to update.
It's rendering accurately on the first pass, but not changing size when the sensor value does:
(trimming down to the relevant line)
group = displayio.Group()
guage_fill = Arc(x=w2,y=h2,radius=g_rad-2, angle=arc_angle, direction=arc_midpt, segments=20, arc_width=int(g_rad/4)-4, outline=RED, fill=RED)
group.append(guage_fill)
display.root_group = group
# Main loop
while True:
sensor_temp=bmp.temperature
sensor_text.text = "{:.2f}°C".format(sensor_temp)
arc_angle = 240*(sensor_temp-temp_min)/(temp_max-temp_min)
arc_midpt = 210-arc_angle/2
guage_fill.angle = arc_angle
guage_fill.direction = arc_midpt
display.refresh()
time.sleep(1)
Refering to the circle animation test, it is just changing the group element's attribute so I figured that this should have worked the same.
I've also tried to group.remove(guage_fill) before changing the values and then appending it back in but that did nothing as well.
Metadata
Metadata
Assignees
Labels
No labels