Skip to content

Instantly share code, notes, and snippets.

View ennui2342's full-sized avatar

Mark Cheverton ennui2342

View GitHub Profile
gem 'twitter', '=5.0.0'
require 'twitter'
require 'sinatra'
require 'json'
set :server, 'webrick'
client = Twitter::REST::Client.new do |config|
config.consumer_key = 'XXX'
config.consumer_secret = 'XXX'
@ennui2342
ennui2342 / Wearable NeoPixel bike lights
Created January 18, 2014 22:37
Example code to produce the dual 'Knight Rider' effect in the 'Wearable Neopixel bike lights' project as described in this blog post: http://ecafe.org/blog/2014/01/18/wearable-neopixel-bike-lights.html
#include <Adafruit_NeoPixel.h>
#define PIN 1
#define NUM_PIXELS 20
#define NUM_NODES 2
Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUM_PIXELS, PIN, NEO_GRB +
NEO_KHZ800);
uint32_t state[NUM_PIXELS];