Skip to content

Instantly share code, notes, and snippets.

View ladyada's full-sized avatar

Limor "Ladyada" Fried ladyada

View GitHub Profile
@ladyada
ladyada / test gist
Created January 30, 2012 00:43
Tester
foo bar
@ladyada
ladyada / gist:2363050
Created April 11, 2012 22:02
Arduino example for USB serial backpack
// Example for using Adafruit USB+Serial Character LCD backpack with an Arduino
// Pick one up today @ http://www.adafruit.com/category/63_96
#include <SoftwareSerial.h>
// Create a software serial port!
SoftwareSerial lcd = SoftwareSerial(0,2);
void setup() {
lcd.begin(9600);
@ladyada
ladyada / coinacceptor.pde
Created April 16, 2012 16:16
Coin acceptor test code using Adafruit RGB LCD shield
/*********************
* connect the COIN wire to digital 2
* set the side switches to "FAST" "NC"
**********************/
// include the library code:
#include <Wire.h>
#include <Adafruit_MCP23017.h>
#include <Adafruit_RGBLCDShield.h>
@ladyada
ladyada / raspi-gmail.py
Created July 6, 2012 19:16
Raspberry Pi LED E-mail Notifier
cat <<! > raspi-gmail.py
#!/usr/bin/env python
import RPi.GPIO as GPIO, feedparser, time
DEBUG = 1
USERNAME = "username" # just the part before the @ sign, add yours here
PASSWORD = "password"
@ladyada
ladyada / adafruit_mcp3008.py
Last active April 7, 2024 18:32
Raspbery Pi Analog Input with MCP3008
#!/usr/bin/env python
# Written by Limor "Ladyada" Fried for Adafruit Industries, (c) 2015
# This code is released into the public domain
import time
import os
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
@ladyada
ladyada / waverfid.ino
Created July 24, 2012 16:30
wave + RFID
#include <WaveHC.h>
#include <WaveUtil.h>
#include <Wire.h>
#include <Adafruit_NFCShield_I2C.h>
#define IRQ 6 // this trace must be cut and rewired!
#define RESET 8
@ladyada
ladyada / adafruit-cosm-temp.py
Last active October 8, 2015 00:28
Raspberrry Pi + MCP300 + TMP36 -> Cosm
#!/usr/bin/env python
import time
import os
import RPi.GPIO as GPIO
import eeml
GPIO.setmode(GPIO.BCM)
DEBUG = 1
LOGGER = 1
@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 / pitftupdater.sh
Last active December 6, 2016 03:25
PiTFT updater scripty
#!/bin/bash
# PiTFT Resistive 2.8" (PID 1601) or Capacitive 2.8" (PID 1983) setup script or Resistive 3.5" (PID 2097) or 2.2" No-Touchscreen setup script!
set -e
function cleanup() {
if [ "${mountpoint}" != "/" ]
then
sudo -n umount "${mountpoint}/boot" 2> /dev/null