Skip to content

Instantly share code, notes, and snippets.

View frequenzteiler's full-sized avatar
💭
building !

frequenzteiler frequenzteiler

💭
building !
View GitHub Profile
@frequenzteiler
frequenzteiler / TwinkleFOX.ino
Created June 24, 2016 17:13 — forked from kriegsman/TwinkleFOX.ino
TwinkleFOX: Colored Twinkling Holiday Lights
#include "FastLED.h"
#if defined(FASTLED_VERSION) && (FASTLED_VERSION < 3001000)
#warning "Requires FastLED 3.1 or later; check github for latest code."
#endif
#define NUM_LEDS 100
#define LED_TYPE WS2811
#define COLOR_ORDER GRB
#include <math.h> // math library for Arduino
const int U_D = 2; // U/D pin on AD5220
const int clk = 5; // CLK pin on AD5220
volatile int counter = 0; // volatile integers are basically global variables, so any function can use them
volatile int pot[2]; // using an array to compare old pot value to new pot value to see if it has changed
volatile int diff[2]; // using a separate variable so we don't accidentally modify our read values
volatile int vol = 0; // volatile integers are basically global variables, so any function can use them
void setup()
{
#include <math.h> // math library for Arduino
const int U_D = 2; // U/D pin on AD5220
const int clk = 5; // CLK pin on AD5220
volatile int counter = 0; // volatile integers are basically global variables, so any function can use them
volatile int pot[2]; // using an array to compare old pot value to new pot value to see if it has changed
volatile int diff[2]; // using a separate variable so we don't accidentally modify our read values
volatile int vol = 0; // volatile integers are basically global variables, so any function can use them
void setup()
{
// Pin Definitions
// Rows are connected to Digital
const int rowPin[] = { 6, 7, 8, 5 };
// FSRs connected to Analog
const int fsrPin[] = { 2, 3, 4, 5 };
// The 74HC595 uses a serial communication
// link which has three pins
const int clock = 12;