Skip to content

Instantly share code, notes, and snippets.

@zamfi
zamfi / 9753457.png
Last active August 29, 2015 13:57
Weird clock thing!
9753457.png
var colors = ["red", "blue", "green", "yellow"];
var directions = [up, down, left, right];
while (remainingDots() > 0) {
directions[Math.floor(Math.random()*directions.length)]();
setColor(colors[Math.floor(Math.random()*colors.length)]);
}
def determine_winner(board):
""" board takes the form of a String
with the indices representing each
of these squares:
0 | 1 | 2
---+---+---
3 | 4 | 5
---+---+---
6 | 7 | 8
@zamfi
zamfi / README.md
Last active November 2, 2015 20:47
communicating with flashes
const int numPins = 12;
const int pins[] = {2,3,4,5,6,7,8,9,10,11,12,13};
void setup() {
for (int i = 0; i < numPins; ++i) {
pinMode(pins[i], OUTPUT);
}
}
int litPin = 0;
const int numPins = 12;
const int pins[] = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13};
const int motionSensePin = A0;
void setup() {
for (int i = 0; i < numPins; ++i) {
pinMode(pins[i], OUTPUT);
}
pinMode(motionSensePin, INPUT);
#include <CapacitiveSensor.h>
/*
* CapitiveSense Library Demo Sketch
* Paul Badger 2008
* Uses a high value resistor e.g. 10M between send pin and receive pin
* Resistor effects sensitivity, experiment with values, 50K - 50M. Larger resistor values yield larger sensor values.
* Receive pin is the sensor pin - try different amounts of foil/metal on this pin
*/
@zamfi
zamfi / .block
Last active August 3, 2017 20:24
testing data
license: mit
@zamfi
zamfi / cycling-hue.js
Last active September 20, 2017 18:28 — forked from anonymous/cycling-hue.js
background(255);
noStroke();
var h = 0;
while(true) {
background(255);
colorMode(HSB);
fill(h, 100, 100);
ellipse(width/2, height/2, 100, 100);
background(255);
strokeWeight(3);
colorMode(HSB);
while (true) {
var h = random(360)
stroke(h, 50, 90);
fill(h, 50, 100);
var r = random(30, 60);