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
# Make an internet clock with CircuitPython using WorldTimeAPI.org | |
# 31 Mar 2024 - @todbot / Tod Kurt | |
# Use resulting strings for displaying on a display of some kind | |
import os, time | |
import wifi | |
import adafruit_requests | |
import socketpool | |
import ssl | |
time_url = "http://worldtimeapi.org/api/ip" |
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
# starting to play with bitmapfilter | |
# 31 Mar 2024 - @todbot / Tod Kurt | |
import time, math, random | |
import board | |
import vectorio | |
import displayio | |
import bitmaptools | |
import bitmapfilter | |
display = board.DISPLAY |
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
""" | |
LilyGo T-Display S3 display hand-setup. Not normally required if using https://circuitpython.org/board/lilygo_tdisplay_s3/ | |
""" | |
import time | |
import board | |
import digitalio | |
import displayio | |
import paralleldisplaybus | |
import adafruit_st7789 |
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
# code.py example for color_palette_finder.py | |
# 9 Mar 2024 - @todbot / Tod Kurt | |
# Needs 'color_palette_finder.py' library | |
# video demo: https://youtu.be/dSR6IVxeaTg | |
import time | |
import board | |
import displayio | |
import vectorio | |
import gc |
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
# Compute the average (median or mean) color of a JPEG using ulab.numpy | |
# 9 Mar 2024 - @todbot / Tod Kurt | |
# Note: test images are included as comment below, max tested resolution 256x192 | |
import ulab.numpy as np | |
import displayio | |
import jpegio | |
def rgb565_to_rgb888(v, swapped=True): | |
"""Convert RGB565 (normal or swapped) to RGB888 tuple""" | |
if swapped: |
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
// from: | |
// https://docs.arduino.cc/retired/library-examples/wifi-library/WiFiWebClient/ | |
#include <WiFi.h> | |
// Enter your WiFi SSID and password | |
char ssid[] = "todbot"; // your network SSID (name) | |
char pass[] = "testtesttest"; // your network password (use for WPA, or use as key for WEP) | |
char server[] = "wifitest.adafruit.com"; // host name address for adafruit test |
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
// lightly modified to print out the top level directory as strings, | |
// like for use with a display | |
/********************************************************************* | |
Adafruit invests time and resources providing this open source code, | |
please support Adafruit and open-source hardware by purchasing | |
products from Adafruit! | |
MIT license, check LICENSE for more information | |
Copyright (c) 2019 Ha Thach for Adafruit Industries |
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
# builds on John Park's Parsec on drawing circle https://www.youtube.com/watch?v=nI55N6q0sUo | |
import math | |
import time | |
import random | |
# Set up the display | |
display = board.DISPLAY | |
# Create a blank displayio group | |
group = displayio.Group() |
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 board | |
import displayio | |
import math | |
import time | |
# Set up the display | |
display = board.DISPLAY | |
# Create a blank displayio group | |
tilegroup = displayio.Group() |
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
// Port of code at https://efundies.com/src/arduino/midi-solenoids.ino | |
// to use fortyseveneffects MIDI library and Adafuit_TinyUSB | |
// Be sure to set Tools -> USB Stack: Adafruit TinyUSB in Arduino IDE | |
#include <Adafruit_TinyUSB.h> | |
#include <MIDI.h> | |
// USB MIDI object | |
Adafruit_USBD_MIDI usb_midi; | |
// Create a new instance of the Arduino MIDI Library, | |
// and attach usb_midi as the transport. |