Skip to content

Unable to change arc size after creation #68

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
qchronod opened this issue Dec 11, 2023 · 0 comments · Fixed by #74
Closed

Unable to change arc size after creation #68

qchronod opened this issue Dec 11, 2023 · 0 comments · Fixed by #74

Comments

@qchronod
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant