[{"element_type":"alert","content":"Please use this ethically and don't be dumb","metadata":{"class":"element row-fluid alert-element build-alert alert-warning","alert_type":"warning"}},{"element_type":"text","content":"\n  \n  \n  \n  \n        \u003cp\u003eHave you ever wanted to trick your friends into letting you shut off their Chromebook, Well now you can.\u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003eFirst you need to install circuit python for the trinkey\u003c/li\u003e\n\u003cli\u003eSecond you need to add the libraries to the trinkeys\u003c/li\u003e\n\u003cli\u003efinally copy the code and save\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003eThe libraries you need are neopixel.mpy and adafruit_hid\u003cbr\u003e\u003cbr\u003e\u003c/p\u003e\n\u003cp\u003e\u0026nbsp;\u003c/p\u003e\n      \n\n\n\n","metadata":{}},{"element_type":"alert","content":"Tell your friend that this lights up and makes cool stuff happen","metadata":{"class":"element row-fluid alert-element build-alert alert-info","alert_type":"info"}},{"element_type":"code","content":"import board\nimport neopixel\nimport time\nimport usb_hid\nfrom adafruit_hid.keyboard import Keyboard\nfrom adafruit_hid.keycode import Keycode\n#libraries are imported\n\nkbd = Keyboard(usb_hid.devices)\nneo = neopixel.NeoPixel(board.NEOPIXEL, 4, brightness=0.05)\ncolor = (255, 0, 0)#red\noff = (0, 0, 0)#well pretty self explanitory\ncolor2 = (125, 125, 0)#yellow\ncolor3 = (0, 255, 0)#green\n\n#loading up anmation\nneo[0] = color\ntime.sleep(0.1)\nneo[1] = color\ntime.sleep(0.1)\nneo[2] = color\ntime.sleep(0.1)\nneo[3] = color\ntime.sleep(0.3)\nneo[0] = off\nneo[1] = off\nneo[2] = off\nneo[3] = off\ntime.sleep(0.1)\nneo[0] = color2\nneo[1] = color2\nneo[2] = color2\nneo[3] = color2\ntime.sleep(0.1)\nneo[0] = off\nneo[1] = off\nneo[2] = off\nneo[3] = off\ntime.sleep(0.1)\nneo[0] = color2\nneo[1] = color2\nneo[2] = color2\nneo[3] = color2\ntime.sleep(0.1)\nneo[0] = color3\nneo[1] = color3\nneo[2] = color3\nneo[3] = color3\n   \n#actuall chromebook shut off\nkbd.press(Keycode.CONTROL, Keycode.SHIFT, Keycode.Q)\n\nkbd.release(Keycode.Q)\nkbd.press(Keycode.Q)\n\n\n    \nwhile True:\n\n\t#just a cool anmation I made\n\n\n\n    ecolor = (random.randint(0, 255), random.randint(0, 255), random.randint(0, 255))\n\n \n    neo[0] = ecolor\n    time.sleep(0.05)\n    neo[1] = ecolor\n    time.sleep(0.05)\n    neo[2] = ecolor\n    time.sleep(0.05)\n    neo[3] = ecolor\n    time.sleep(0.0)","metadata":{"language":"python","linenums":false}},{"element_type":"product","content":"https://www.adafruit.com/product/4870","metadata":{}}]