This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# convert a .png image file to a .bmp image file using PIL | |
from PIL import Image | |
import os | |
for file in os.listdir("."): | |
file_in = file | |
if ".png" in file: | |
img = Image.open(file_in) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import supervisor | |
import time | |
import board | |
import neopixel | |
from digitalio import DigitalInOut, Pull | |
led = neopixel.NeoPixel(board.NEOPIXEL, 1, brightness=0.3, auto_write=True) | |
led[0] = 0x000000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import serial | |
import time | |
send_time = 4 # sec after starting | |
sent = False | |
START_TIME = time.monotonic() | |
with serial.Serial('/dev/ttyACM0', 19200, timeout=1) as ser: | |
while True: | |
if not sent: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import supervisor | |
import usb_hid | |
from adafruit_hid.keyboard import Keyboard | |
from adafruit_hid.keycode import Keycode | |
kbd = Keyboard(usb_hid.devices) | |
def send_q(): | |
kbd.send(Keycode.Q) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import board | |
import vectorio | |
import displayio | |
from rainbowio import colorwheel | |
scarf_palette = displayio.Palette(1) | |
scarf_palette[0] = colorwheel(128) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import board | |
from digitalio import DigitalInOut, Direction, Pull | |
LONG_PRESS_DURATION = 0.65 # seconds | |
btn_select = DigitalInOut(board.BUTTON_SELECT) | |
btn_select.direction = Direction.INPUT | |
btn_select.pull = Pull.DOWN |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SPDX-FileCopyrightText: 2020 Tim C | |
# | |
# SPDX-License-Identifier: Unlicense | |
""" | |
Make green and purple rectangles and a | |
"Hello World" label. | |
""" | |
import displayio | |
import terminalio | |
from adafruit_display_text import label |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import board | |
import displayio | |
import adafruit_imageload | |
from adafruit_displayio_layout.widgets.easing import back_easeinout as easein | |
from adafruit_displayio_layout.widgets.easing import back_easeinout as easeout | |
def _animate_value( | |
start_val, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Author: Michael Hadley, mikewesthad.com | |
* Asset Credits: | |
* - Tuxemon, https://github.com/Tuxemon/Tuxemon | |
*/ | |
const config = { | |
type: Phaser.AUTO, | |
width: 800, | |
height: 600, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LOGGING = { | |
'version': 1, | |
'disable_existing_loggers': False, | |
'formatters': { | |
"timestamped": { | |
'format': '%(asctime)s %(name)-12s %(levelname)-8s %(message)s', | |
} | |
}, | |
'handlers': { | |
'console': { |