Skip to content

Instantly share code, notes, and snippets.

@jbobrow
Last active July 8, 2020 15:28
Show Gist options
  • Save jbobrow/3ebac699269a68f255034665fce51b78 to your computer and use it in GitHub Desktop.
Save jbobrow/3ebac699269a68f255034665fce51b78 to your computer and use it in GitHub Desktop.
/*
* Rikki Tahta Sketch
*
* Count up.
* Each click counts up
* Double-click becomes a different display mode
*/
byte count = 0;
bool bFlicker = false;
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
if(buttonSingleClicked()) {
count = (count+1) % 7;
}
if(buttonDoubleClicked()) {
bFlicker = !bFlicker;
}
setColor(OFF);
FOREACH_FACE(f) {
if(f < count ) {
if(bFlicker) {
setColorOnFace(dim(WHITE, 102 + 51*random(3)), f);
}
else {
setColorOnFace(WHITE, f);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment