from schoginitoys import *
# Function to animate a single LED dot moving through the outer periphery of the display
def animate_dot():
# Initialize the starting position of the dot
col = 0
row = 0
# Loop to animate the dot moving through the outer periphery of the display
while True:
# Set the current dot position to ON
display.set_pixel(col, row, 1)
display.show()
# Delay to control the speed of animation
time.sleep(0.1)
# Clear the current dot position
display.set_pixel(col, row, 0)
display.show()
# Update the dot position for the next iteration
if col < 31 and row == 0:
col += 1
elif col == 31 and row < 7:
row += 1
elif col > 0 and row == 7:
col -= 1
elif col == 0 and row > 0:
row -= 1
else:
break
# Call the function to start the animation
animate_dot()