Skip to content

Instantly share code, notes, and snippets.

View ladyada's full-sized avatar

Limor "Ladyada" Fried ladyada

View GitHub Profile
@ladyada
ladyada / gist:42e738bbc2d6014d127c
Created February 22, 2015 01:25
daftpunkonsole.ino
#include <Wire.h>
#include "Adafruit_Trellis.h"
#include <SoftwareSerial.h>
#include "Adafruit_Soundboard.h"
/************ sound board setup ***********/
// Choose any two pins that can be used with SoftwareSerial to RX & TX
#define SFX_TX 5
#define SFX_RX 6
// Connect to the RST pin on the Sound Board
@ladyada
ladyada / ar1100cal.py
Last active March 19, 2018 23:01
ar1100.py auto-calibrator
#!/usr/bin/python
import sys
import usb.core
import usb.util
import time
import os
import pygame
from pygame.locals import*
def mapnum(x, in_min, in_max, out_min, out_max):

Keybase proof

I hereby claim:

  • I am ladyada on github.
  • I am ladyada (https://keybase.io/ladyada) on keybase.
  • I have a public key ASBl1-cokjGT52e6QFsXIXbUGwEWIGJTpJZdV5cToeYMIQo

To claim this, I am signing this object:

@ladyada
ladyada / adafruitlightpaint4pi.py
Created August 10, 2012 00:26
Adafruit Light Painting with Pi
#!/usr/bin/python
# Light painting / POV demo for Raspberry Pi using
# Adafruit Digital Addressable RGB LED flex strip.
# ----> http://adafruit.com/products/306
import RPi.GPIO as GPIO, Image, time
# Configurable values
filename = "hello.png"
@ladyada
ladyada / code.py
Created November 9, 2020 01:11
CircuitPython Countdown for MagTag Demo
import sys
import time
import board
import wifi
import socketpool
import adafruit_requests
import ssl
import rtc
import displayio
import terminalio
@ladyada
ladyada / gist:fd6dbc5a7efdc3e01468416603d38df5
Created March 27, 2021 21:15
Feather RP2040 + SPI TFT + MCP9808 Demo
#include <SPI.h>
#include "Adafruit_GFX.h"
#include "Adafruit_ILI9341.h"
#include "Adafruit_MCP9808.h"
#include <Fonts/FreeSans18pt7b.h>
// These are 'flexible' lines that can be changed
#define TFT_CS 9
#define TFT_DC 10
#include <SPI.h>
#include <SD.h>
// Set the pins used
#define cardSelect 4
File logfile;
// blink out an error code
void error(uint8_t errno) {
@ladyada
ladyada / config.txt
Created February 18, 2016 21:57
customized HDMI output
# uncomment if you get no picture on HDMI for a default &quot;safe&quot; mode
#hdmi_safe=1
# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan
#disable_overscan=1
# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
#overscan_left=16
@ladyada
ladyada / cleanup_libraries.py
Created October 21, 2023 16:54
clean & update arduino libraries python script
SSH_KEY_PATH = "C:\\\\Users\\\\ladyada\\\\github.ppk" # change path to your ppk or other pubkey file!
import os
import re
import subprocess
def sanitize_name(name):
return re.sub(r'[^a-zA-Z0-9]', '_', name)
def git_actions(folder_path):
import serial
import io
import struct
from adafruit_debouncer import Debouncer
PORT = "COM7" # update me to match your setup!
BUTTON_0_MASK = 0b000000000010000
BUTTON_1_MASK = 0b000000100000000
BUTTON_2_MASK = 0b000001000000000