From 0d2f10b4107bd3c43e82df12f834fb780fb4e256 Mon Sep 17 00:00:00 2001 From: Neale Pickett Date: Sun, 15 Mar 2020 14:20:34 -0600 Subject: [PATCH] Reset after each loop to prevent freezes --- wallart.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/wallart.py b/wallart.py index 750874c..285ab8d 100644 --- a/wallart.py +++ b/wallart.py @@ -1,6 +1,3 @@ -# Trinket IO demo -# Welcome to CircuitPython 3.1.1 :) - import board from digitalio import DigitalInOut, Direction, Pull import adafruit_dotstar as dotstar @@ -8,9 +5,11 @@ import adafruit_fancyled.adafruit_fancyled as fancy import time import neopixel import random +import microcontroller # One pixel connected internally! dot = dotstar.DotStar(board.APA102_SCK, board.APA102_MOSI, 1, brightness=0.2) +dot[0] = 0 # Built in red LED led = DigitalInOut(board.D13) @@ -63,6 +62,7 @@ def singleCursor(): pos = 20 for i in range(80): grid[pos] = red * (i % 2) + led.value = not (i % 2) grid.show() time.sleep(0.08) @@ -96,6 +96,9 @@ def loop(): singleCursor() sparkle() glitchPulse() + # For some reason, this program freezes occasionally. + # I don't want to debug CircuitPython. + microcontroller.reset() while True: loop()