my project is to have Bluetooth controlled leds where when i press the button on my phone one led turns on and the other flashes; i need to end the while loop when the button is pressed again but i am having problems.
much appreciated and thanks in advance
[ if (rxValue.find("A") != -1) {
flash = true;
Serial.print("Turning ON!");
digitalWrite(LED, HIGH);
while(flash = true) {
digitalWrite(LED2, HIGH);
delay(100);
digitalWrite(LED2, LOW);
delay(100);
}
}
else if (rxValue.find("B") != -1) {
Serial.print("Turning OFF!");
(flash = false);
digitalWrite(LED, LOW);
digitalWrite(LED2, LOW);
}
Serial.println();
Serial.println("*********");
}
}
};]
RECENT_led_flash_bluetooth.ino (3.94 KB)