Skip to content

Instantly share code, notes, and snippets.

@ledlogic
ledlogic / EEPROMExample.ino
Created January 24, 2015 16:28
Example for Arduino EEPROM read / writes
/////////////////////////////////////////////////////////////////
// Created by Kevin Elsenberger //
// June 2, 2013 //
// elsenberger.k at gmail.com //
// from http://playground.arduino.cc/Code/EEPROMReadWriteLong //
/////////////////////////////////////////////////////////////////
//Needed to access the eeprom read write functions
#include <EEPROM.h>
@ledlogic
ledlogic / singleStat.rb
Created January 25, 2015 19:07
Ruby program to load single column CSV file and compute descriptive statistics.
require 'csv'
require 'descriptive_statistics'
#data array to store values
data = []
# load data
CSV.foreach('20150124.csv') do |row|
data << row[0]
end
@ledlogic
ledlogic / har2csv.rb
Created February 27, 2016 00:47
Extract urls from har file to csv (text) file.
#!/usr/bin/ruby
require 'rubygems'
require 'json'
require 'csv'
infile = ARGV[0]
json = File.read(infile)
parsed = JSON.parse(json.encode("UTF-8"))
outfile = ARGV[1]
@ledlogic
ledlogic / Klingon-D7.ino
Last active September 14, 2020 03:37
Arduino script for lighting of a Klingon D7 model
/*
Klingon-D7
1) Light up impulse lights (pin 11)
2) Detect button press (pin 2)
3) Fire torpedo (pin 9)
*/
int PIN_TORPEDO_BUTTON = 2;
int PIN_TORPEDO = 9;
int PIN_IMPULSE = 11;
@ledlogic
ledlogic / techno_obelisk.ino
Last active August 15, 2022 06:35
A rendering for an eerie obelisk.
#include <Adafruit_NeoPixel.h>
#define PIN 1
//single pixel, v2 Flora RGB NeoPixel, so GRB bitsream at 800 khz
Adafruit_NeoPixel strip = Adafruit_NeoPixel(4, PIN, NEO_GRB + NEO_KHZ800);
// assuming we have adafruit gemma v2
// http://adafru.it/1222
// assuming we have four fiora RGB neopixels
@ledlogic
ledlogic / stargate.pde
Created September 21, 2022 01:29
An animation for use behind a circular stargate
double dim = 600;
double center = dim/2;
double offsetX = 0;
double offsetY = 0;
double range = 10;
double scale = dim / range;
double plotWidth = 0.05;
double plotIncrement = 0.1;
double sinhFactor = 1.25; // 1.25