Skip to content

Instantly share code, notes, and snippets.

@GantMan
Created July 17, 2021 16:22
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save GantMan/c48aeafea99c01f3a09b9b506a09832c to your computer and use it in GitHub Desktop.
Neopixel Trinkie April Fools Code
import time
import board
import neopixel
# Mouse stuff
import usb_hid
from adafruit_hid.mouse import Mouse
mouse = Mouse(usb_hid.devices)
# Annoying config
jump_distance = 75 # jump 75 pixels
delay_time = 60 # every 60 seconds
# Turn off LED
pixels = neopixel.NeoPixel(board.NEOPIXEL, 4, auto_write=True)
pixels.brightness = 0
tracker = time.monotonic()
while True:
if time.monotonic() - tracker < delay_time:
continue
mouse.move(x=-jump_distance, y=-jump_distance)
# Double click
mouse.click(Mouse.LEFT_BUTTON)
mouse.click(Mouse.LEFT_BUTTON)
tracker = time.monotonic()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment