Skip to content

Commit

Permalink
Add Garbage Collection to weather example
Browse files Browse the repository at this point in the history
The existing weather example was resulting in `OSError: [Errno 12]
ENOMEM` when executing subsequent calls to the open-meteo API.
  • Loading branch information
LeePorte committed Jul 24, 2024
1 parent 3315b49 commit 4893df6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions micropython/examples/plasma_stick/weather.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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()

0 comments on commit 4893df6

Please sign in to comment.