Created
April 19, 2019 01:54
-
-
Save jbobrow/fac9f3199c3edbf95d0f9749ae33a113 to your computer and use it in GitHub Desktop.
Sends on all faces, packets and broadcast
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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 | |
*/ | |
void setup() { | |
// put your setup code here, to run once: | |
} | |
void loop() { | |
/* | |
Broadcast face values on faces | |
and show colors on each face | |
*/ | |
FOREACH_FACE(f) { | |
setValueSentOnFace(f, f); | |
setColorOnFace(makeColorHSB(f * 42, 255, 255), f); | |
} | |
/* | |
Force send packet when button pressed | |
*/ | |
if (buttonPressed()) { | |
char packet[] = "hello world!"; | |
FOREACH_FACE(f) { | |
sendPacketOnFace(f, (byte *) packet, sizeof(packet)); | |
} | |
setColor(WHITE); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment