Skip to content

Instantly share code, notes, and snippets.

#define SYNC_PAUSE_DURATION 200
byte urge = 0;
byte brightness = 0;
Timer faceTimer[6];
Timer sendTimer;
void setup() {
@jbobrow
jbobrow / WakeSleepProgram.ino
Created December 17, 2018 07:04
not a code reference, just an animation reference
/*
Wake, Sleep, Program
Wake - simple spiral before loading game state
Sleep - simple spiral in reverse before going dark
Program - flash with urgency
*/
uint32_t timeOfPress;
@jbobrow
jbobrow / Long Press validation
Created March 1, 2019 21:30
Test the long press validation with action on release
/*
* Button Long Press and confirm on release
*/
bool hasBeenLongPressed = false;
bool bFastPulse = false;
byte bri[6];
void setup() {
@jbobrow
jbobrow / SerialReporter.ino
Created April 19, 2019 01:04
A sort of Blinks stethoscope
/*
Serial Reporter
---------------
A utility app designed to make debugging of games
that are buggy in transmitting game state. Essentially,
this blink is a stethoscope for Blinks.
The Serial Reporter will:
1. Look for values received on all faces
2. Print values when received on faces
@jbobrow
jbobrow / BlinksBasicSender.ino
Created April 19, 2019 01:54
Sends on all faces, packets and broadcast
/*
Basic Blinks Sender
-------------------
The Blinks Sender will:
1. Broadcast the number of the face on each face
2. When button pressed, send a Packet with a secret message
by Jonathan Bobrow, Move38
04.18.2019
@jbobrow
jbobrow / BlinkDrop.cpp
Last active September 19, 2019 19:15
Drag'n'Drop Blinks Uploader
//--------------------------------------------------------------
void ofApp::dragEvent(ofDragInfo dragInfo){
// Retrieve the path of the single file dropped on our window
filepath = dragInfo.files[0];
// Create a string for the entire command needed to load FW onto a Blink
commandString = "avrdude -p m168pb -P usb -c usbtiny -U flash:w:" + filepath;
// Convert string to const char * as system requires parameter of type const char *
/*
Blinks Dev-Kit
Validation Test for Dev Kit Blinks
4 modes for testing
1. Verify RGB on all 6 faces together
2. Verify RGB on each of the 6 faces individually
3. Verify communication w/ awake neighbors
4. Verify cold sleep (<0.2µA)
/*
PIRATES 'N' LASERS
Animation Prototype
Lasers
1. Dim Ships Status (Fade to Black)
2. Instant redline w/ exposure flash (Simultaneous w/ Dimming)
3. Step by step explosions @ 400ms per segment
4. Fade up the status of the ship
5. Fade a single health to black.
@jbobrow
jbobrow / ReactorColors.ino
Created May 13, 2020 15:06
Color updates
// State machine map: https://docs.google.com/presentation/d/1CsAItlWN2fxssGJggbDrWCFktAbGhIYJ73E4aiDmlCU/edit#slide=id.g6f17dd6178_0_0
// **********************************************************************
// **** TUNABLE CONSTANTS ***********************************************
// **********************************************************************
#define masterColorSwitchGapLength 100 // Dark time in between color switches
#define masterColorSwitchLengthMin 600
#define masterColorSwitchLengthMax 1200
#define masterColorSwitchLengthDelta 100
/*
* Rikki Tahta Sketch
*
* Count up.
* Each click counts up
* Double-click becomes a different display mode
*/
byte count = 0;
bool bFlicker = false;