chance variable matters now
This commit is contained in:
parent
fde662bbee
commit
c41f6ddcc0
|
@ -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(100) < chance) {
|
||||
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.
|
||||
|
|
|
@ -89,8 +89,14 @@ void setup() {
|
|||
}
|
||||
|
||||
void loop() {
|
||||
bool strike = false;
|
||||
String trigger = readFromBluetooth();
|
||||
if (trigger==String("f")) {
|
||||
strike = true;
|
||||
} else if (random(100) < chance) {
|
||||
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.
|
||||
|
|
Loading…
Reference in New Issue