Skip to content

Instantly share code, notes, and snippets.

View bhagman's full-sized avatar

Brett Hagman bhagman

View GitHub Profile
@AlexanderBrevig
AlexanderBrevig / gist:6217627
Last active December 21, 2015 00:08
WProperty prototype
/*
||
|| @author Alexander Brevig <abrevig@wiring.org.co>
|| @url http://wiring.org.co/
|| @contribution Brett Hagman <bhagman@wiring.org.co>
|| @contribution Hernando Barragan <b@wiring.org.co>
||
|| @description
|| | A public field wrapper for providing assignment safe guards
|| #
class PropertyTester {
public:
PropertyTester()
: threshold()
, increment(PropertyTester::incrementAssignSafetyGuard)
, isIncrementing(_isIncrementing) {
_isIncrementing = true;
}
Property<int> threshold;
ConstrainedProperty<int> increment;
@AlexanderBrevig
AlexanderBrevig / Wiring vNEXT
Created February 22, 2014 13:25
Wiring vNEXT
/*
BEAT BLINKER
Simple demo of how to use two processing units
to implement a 'used to be' hard problem
*/
Microphone mic = Microphone(2, 8000); //pin 2 samplerate 8000 ?
Filter lowPass = LowPassFilter(100);
Threshold threshold = Threshold(50); //50%
LED beatBlinker = LED(WLED);