Skip to content

Instantly share code, notes, and snippets.

View joeycastillo's full-sized avatar

Joey Castillo joeycastillo

View GitHub Profile
@joeycastillo
joeycastillo / code.py
Created January 24, 2020 21:10
Capacitive Touch Matrix Test
"""
Test script for CAPT-B1-02 Capacitive Touch Matrix FeatherWing
Board files: https://github.com/joeycastillo/Feather-Projects/tree/master/Experiments/Cap%20Touch%20Experiments
Also uses an Adafruit 16x8 LED matrix:
https://www.adafruit.com/product/2037
"""
import board
import touchio
@joeycastillo
joeycastillo / babeldemo.py
Last active January 27, 2020 04:04
defines the BabelFont class and uses it to draw text in several languages
import board
import displayio
import digitalio
import busio
import time
import struct
from adafruit_display_text import label
from digitalio import Direction, DigitalInOut
from adafruit_bitmap_font import bitmap_font, glyph_cache
try:
import board
import displayio
import time
import struct
import storage
from adafruit_display_text import label
from adafruit_bitmap_font import bitmap_font, glyph_cache
try:
from displayio import Glyph
@joeycastillo
joeycastillo / arrows.bmp
Last active May 15, 2022 03:14
Bike commuter computer with the Adafruit CLUE
@joeycastillo
joeycastillo / BPMBikeLight.ino
Created February 11, 2020 16:21
Blink an LED with the beat
// tap primary button repeatedly to set the beat; averages up to 8 taps
// tap secondary button to cycle mode (blink -> on -> off -> blink)
// connect each input to a finger-sized copper pad with a 1MΩ pull-down
#define PRIMARY_BUTTON 14
#define SECONDARY_BUTTON 9
#define LIGHT 5
#define BIKE_LIGHT_MODE_BLINK 0
#define BIKE_LIGHT_MODE_ON 1
#define BIKE_LIGHT_MODE_OFF 2
@joeycastillo
joeycastillo / COVID_Tracker.ino
Last active March 29, 2020 18:35
Displays latest coronavirus cases for the world, the US and individual states
/* COVID-19 Case Tracker
*
* Use a quad 2x2 FeatherWing kit with tall stacking headers on the top left quadrant.
* Solder the remaining non-stacking header into the M0 Wifi, so it can plug in on the underside.
* 14-segment displays on top row; leave the left display's address alone, close A0 jumper on the right display.
* 7-segment displays on bottom row; close A0 and A2 on the left display, A1 and A2 on the right one.
*/
#include <SPI.h>
#include <Wire.h>
@joeycastillo
joeycastillo / Hiking_Log_With_Screen.ino
Created April 14, 2020 20:06
the Hiking Log with a tiny screen
#include <Adafruit_SPIFlash.h>
#include <Adafruit_GPS.h>
#include <DHT.h>
#include <avr/dtostrf.h>
#include <Adafruit_GFX.h>
#include <Adafruit_ST7789.h>
#include <SPI.h>
#define TFT_CS 6
#define TFT_RST 11
@joeycastillo
joeycastillo / code.py
Created July 29, 2020 03:20
demo of babel multi-language support in CircuitPython
import board
import digitalio
from babel.babelflash import FlashBabel
from adafruit_display_text import label
cs = digitalio.DigitalInOut(board.BCS) # replace with board.D4 on e-book wing
babel = FlashBabel(cs)
display = board.DISPLAY
text = """Short sayings:
@joeycastillo
joeycastillo / bluemarble.py
Created August 1, 2020 20:12
Display real-time GOES-East imagery on a Waveshare 7-color EPD
# Based on Waveshare's epd5in65f.py demo. Copyright notice at end.
import sys
import os
picdir = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), 'pic')
libdir = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), 'lib')
if os.path.exists(libdir):
sys.path.append(libdir)