Skip to content

Instantly share code, notes, and snippets.

@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
@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 / 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 / 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 / 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 / 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 / LCDDiceRoller.iso
Last active August 29, 2015 14:14
LCDDiceRoller.iso
/*************************************************************************************
Dieroller
Uses the library TrueRandom from https://code.google.com/p/tinkerit/wiki/TrueRandom
(c) 2015 Jeff D. Conrad
**************************************************************************************/
#include <LiquidCrystal.h>
@ledlogic
ledlogic / AlphabetGame.ino
Created October 28, 2014 16:15
A setup for the Alphabet Game - three buttons are required, and players attempt to be the first to find the next letter.
#include <LiquidCrystal.h>
LiquidCrystal lcd(8, 9, 4, 5, 6, 7); // select the pins used on the LCD panel
int bluePin = 11;
int greenPin = 12;
int redPin = 13;
void setup()
{
@ledlogic
ledlogic / LCD_Buttons.ino
Created August 23, 2014 02:56
Worked right out of the box, excellent program from Mark Bramwell.
/*************************************************************************************
Mark Bramwell, July 2010
This program will test the LCD panel and the buttons.When you push the button on the shield,
the screen will show the corresponding one.
Connection: Plug the LCD Keypad to the UNO(or other controllers)
**************************************************************************************/
@ledlogic
ledlogic / LCDTempOneWire.ino
Created August 23, 2014 02:39
LCD display of temp with lcd + onewire + dallas libraries
#include <OneWire.h>
#include <DallasTemperature.h>
#include <LiquidCrystal.h>
// Data wire is plugged into pin 1 on the Arduino
#define ONE_WIRE_BUS 1
// Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
OneWire oneWire(ONE_WIRE_BUS);