From 4893df676f4ef273024f9c125d21a1557ff0f91b Mon Sep 17 00:00:00 2001 From: Lee Porte Date: Wed, 24 Jul 2024 20:19:26 +0100 Subject: [PATCH] Add Garbage Collection to weather example The existing weather example was resulting in `OSError: [Errno 12] ENOMEM` when executing subsequent calls to the open-meteo API. --- micropython/examples/plasma_stick/weather.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/micropython/examples/plasma_stick/weather.py b/micropython/examples/plasma_stick/weather.py index bb0374d1c..eaa1872ed 100644 --- a/micropython/examples/plasma_stick/weather.py +++ b/micropython/examples/plasma_stick/weather.py @@ -3,6 +3,7 @@ import uasyncio import urequests import time +import gc import plasma from plasma import plasma_stick # Random functions! randrange is for picking integers from a range, and uniform is for floats. @@ -258,3 +259,5 @@ def snow(): move_to_target() # nudge our current colours closer to the target colours display_current() # display current colours to strip + gc.collect() +