Skip to content

Instantly share code, notes, and snippets.

@mattnupen
mattnupen / gist:9906062
Created April 1, 2014 01:32
Arduino, Adafruit Neopixel Strip, Sparfun MPR121 board
#include <Adafruit_NeoPixel.h>
#define PIN 6
Adafruit_NeoPixel strip = Adafruit_NeoPixel(60, PIN, NEO_GRB + NEO_KHZ800);
#include "mpr121.h"
#include <Wire.h>
int irqpin = 2; // Digital 2
@mattnupen
mattnupen / Adafruit's Default Earring Code
Last active August 29, 2015 13:57
Gemma Hoop Earring Class Sketches
// Low power NeoPixel earrings example. Makes a nice blinky display
// with just a few LEDs on at any time...uses MUCH less juice than
// rainbow display!
#include <Adafruit_NeoPixel.h>
#define PIN 0
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(32, PIN);
@mattnupen
mattnupen / analog input melody
Created October 1, 2012 21:18
Lady GaGa's Poker Face melody controlled by analog input
/*
plays melody and fades led based on analog input
changes from sketch 3:
* had to change led and speaker pins due to PWM timing issues
http://arduino.cc/en/Reference/Tone
* moved sensor and LED code into the for loop so that it is updated as the song runs. makes program more responsive.
circuit:
* piezo speaker on D9
* potentiometer with center wire to A0
@mattnupen
mattnupen / fadeled
Created September 27, 2012 18:40
fading led with potentiometer
int sensorVal = 0;
int sensorPin = A0;
int ledPin = 11;
void setup() {
// put your setup code here, to run once:
pinMode(ledPin,OUTPUT);
pinMode(sensorPin,INPUT);
Serial.begin(9600);
}