Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions cloud-lightning-photon/cloud-lightning-photon.ino
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,13 @@ void loop() {
}

int triggerWeather(String command) {

if (command==String("f")) {
bool strike = false;
if (command==String("f")) {
strike = true;
} else if (random(chance) == 0) {
strike = true;
}
if (strike) {
int led = random(PIXEL_COUNT);
for (int i = 0; i < 10; i++) {
// Use this line to keep the lightning focused in one LED.
Expand Down
6 changes: 6 additions & 0 deletions cloud-lightning/cloud-lightning.ino
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,14 @@ void setup() {
}

void loop() {
bool strike = false;
String trigger = readFromBluetooth();
if (trigger==String("f")) {
strike = true;
} else if (random(chance) == 0) {
strike = true;
}
if (strike) {
int led = random(NUM_LEDS);
for (int i = 0; i < 10; i++) {
// Use this line to keep the lightning focused in one LED.
Expand Down