Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View mikedotalmond's full-sized avatar

Mike Almond mikedotalmond

View GitHub Profile
@mikedotalmond
mikedotalmond / keybase.md
Created October 20, 2014 19:44
Keybase proof

Keybase proof

I hereby claim:

  • I am mikedotalmond on github.
  • I am mikealmond (https://keybase.io/mikealmond) on keybase.
  • I have a public key whose fingerprint is 5739 026D 5DBB B018 114E DF65 DE3F CC0C 4EE8 88D5

To claim this, I am signing this object:

@mikedotalmond
mikedotalmond / Lorenz.hx
Created May 15, 2015 01:05
Lorenz attractor
package;
/**
* ...
* @author Mike Almond - https://github.com/mikedotalmond
*/
class Lorenz {
public var sigma:Float;
public var rho:Float;
@mikedotalmond
mikedotalmond / SharedMemory.hx
Created November 5, 2015 23:54
SharedMemory - Use with the Haxe flash.Memory API for fast (shared) ByteArray access.
package;
import flash.Memory;
import flash.utils.ByteArray;
import flash.utils.Endian;
import flash.Vector;
/**
* ...
* @author Mike Almond - https://github.com/mikedotalmond
@mikedotalmond
mikedotalmond / StarlingSpriteSheet.hx
Created November 22, 2013 14:01
StarlingSpriteSheet / SubImageSprite for Flambe
class StarlingSpriteSheet {
public static function parse(atlasXml:Xml, texture:Texture):Map<String,SubImageSprite> {
var spritesMap = new Map<String, SubImageSprite>();
for (el in atlasXml.elements()) {
if (el.nodeName == 'TextureAtlas') {
var textures = el.elementsNamed('SubTexture');
@mikedotalmond
mikedotalmond / pir-audio.ino
Created April 9, 2016 01:30
PIR audio trigger
/*
*/
#include <WaveHC.h>
#include <WaveUtil.h>
const int minimumSoundInterval = 2000;
const int soundIntervalRange = 8000;
boolean playingSound = false;
int lastPlayed = 0;
@mikedotalmond
mikedotalmond / lamp-leds.ino
Created April 11, 2016 05:34
Randomly turn pixels on/off on 3 8x8 LED displays
/**
* Randomly turn pixels on/off on 3 8x8 LED displays
* @author Mike Almond - @mikedotalmond | github.com/mikedotalmond
*/
#include "LedControl.h"
const int LED_DATA = 2;
const int LED_LOAD = 3; // CS
const int LED_CLK = 4;
@mikedotalmond
mikedotalmond / HC_SR04_UltrasoundDistanceSensor.ino
Last active July 6, 2017 14:01
Example sketch for working with the HC-SR04 Ultrasound distance sensor. Uses https://github.com/mikedotalmond/arduino-pulseInWithoutDelay
/**
* @author Mike Almond - @mikedotalmond
*
* Example sketch for working with the HC-SR04 Ultrasound distance sensor
* http://users.ece.utexas.edu/~valvano/Datasheets/HCSR04b.pdf
*
* Uses a hardware interrupt to monitor the echo pin and measure the pulse length (without pausing code execution like you would when using Arduino::pulseIn())
* https://github.com/mikedotalmond/arduino-pulseInWithoutDelay
* PulseInZero uses interrupt 0 ( pin 2 on arduino uno)
* PulseInOne uses interrupt 1 ( pin 3 on an arduino uno)