Skip to content

Instantly share code, notes, and snippets.

@JamRud
JamRud / gist:9cabf80d72d5b511d582b1369f960453
Created March 12, 2017 15:41
Neopixel Ring with attiny85
#include <Adafruit_NeoPixel.h>
const int neoPixelPin = 1; //control pin
const int numPixels = 12; // number of pixels
int sensorOne = 0;
int blue = 255;
//set up strip
/*
Music player
Plays a directory of music
Plays songs in a subdirectory of the sketch called music
Put any songs you want in the music subdirectory, then
copy the list of song names into the songs[] array.
created by Tom Igoe
@JamRud
JamRud / gist:74ae46319699fcc91421b02650a06ff6
Created February 20, 2017 18:21
Music Player Arduino Code
#include <Keyboard.h>
int buttonStateOne = 0;
int lastButtonStateOne = 0;
int buttonStateTwo = 0;
int lastButtonStateTwo = 0;
int buttonStateThree = 0;
int lastButtonStateThree = 0;
int buttonStateFour = 0;
int lastButtonStateFour = 0;
@JamRud
JamRud / gist:e78c0a56c96257513b10f1ec80555c00
Created February 20, 2017 17:28
Tom Igoe's Music Player Code in P5.js
// Tom Igoe's code
// Music Player
// Plays song in a subdirectory of the sketch called music
// Put any songs you want in the subdirectory, then copy
// the list of song names into the songs[] array.
var song; //the sound file to be played
//Code courtesy of www.interactivemateriality.com
#define RUBBERPIN A0
// how many samples to take and average, more takes longer
// but is more 'smooth'
#define NUMSAMPLES 5
// the value of the 'other' resistor
#define SERIESRESISTOR 10000
int samples[NUMSAMPLES];
#include <Adafruit_NeoPixel.h>
const int neoPixelPin = 6; //control pin
const int numPixels = 12; // number of pixels
int sensorOne = 0;
int blue = 255;
int sensorTwo = 0;
int red = 255;
int sensorThree = 0;