Have you ever wanted to trick your friends into letting you shut off their Chromebook, Well now you can.
- First you need to install circuit python for the trinkey
- Second you need to add the libraries to the trinkeys
- finally copy the code and save
The libraries you need are neopixel.mpy and adafruit_hid
import board
import neopixel
import time
import usb_hid
from adafruit_hid.keyboard import Keyboard
from adafruit_hid.keycode import Keycode
#libraries are imported
kbd = Keyboard(usb_hid.devices)
neo = neopixel.NeoPixel(board.NEOPIXEL, 4, brightness=0.05)
color = (255, 0, 0)#red
off = (0, 0, 0)#well pretty self explanitory
color2 = (125, 125, 0)#yellow
color3 = (0, 255, 0)#green
#loading up anmation
neo[0] = color
time.sleep(0.1)
neo[1] = color
time.sleep(0.1)
neo[2] = color
time.sleep(0.1)
neo[3] = color
time.sleep(0.3)
neo[0] = off
neo[1] = off
neo[2] = off
neo[3] = off
time.sleep(0.1)
neo[0] = color2
neo[1] = color2
neo[2] = color2
neo[3] = color2
time.sleep(0.1)
neo[0] = off
neo[1] = off
neo[2] = off
neo[3] = off
time.sleep(0.1)
neo[0] = color2
neo[1] = color2
neo[2] = color2
neo[3] = color2
time.sleep(0.1)
neo[0] = color3
neo[1] = color3
neo[2] = color3
neo[3] = color3
#actuall chromebook shut off
kbd.press(Keycode.CONTROL, Keycode.SHIFT, Keycode.Q)
kbd.release(Keycode.Q)
kbd.press(Keycode.Q)
while True:
#just a cool anmation I made
ecolor = (random.randint(0, 255), random.randint(0, 255), random.randint(0, 255))
neo[0] = ecolor
time.sleep(0.05)
neo[1] = ecolor
time.sleep(0.05)
neo[2] = ecolor
time.sleep(0.05)
neo[3] = ecolor
time.sleep(0.0)
This page (Chrome Book Shutter-Offer using Neo Trinkey) was last updated on March 22, 2024.