Format Gemma Space Invader Pendant
MODIFY
Trinket_Gemma_Space_Invader_Pendant/Trinket_Gemma_Space_Invader_Pendant.py
Trinket_Gemma_Space_Invader_Pendant/Trinket_Gemma_Space_Invader_Pendant.py
-import board
import time
-import busio as io
+
import adafruit_ht16k33.matrix
+import board
+import busio as io
import touchio
touch = touchio.TouchIn(board.D1)
@@ -106,7 +107,6 @@ anim = [
[0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0]]
]
-
#
# run until we are out of animation frames
# use Gemma's built-in reset button or switch to restart
@@ -114,7 +114,7 @@ anim = [
# populate matrix
while True:
- if ( frame_count < len(anim) ):
+ if frame_count < len(anim):
for x in range(xpix):
for y in range(ypix):
matrix.pixel(x, y, anim[frame_count][x][y])
@@ -136,5 +136,5 @@ while True:
# A0/D1 pin has been touched
# reset animation
- if ( touch.value ):
+ if touch.value:
frame_count = 0

Format Gemma Space Invader Pendant