Hi all,
I was just needing some help with controlling several LEDs on and off times through serial monitor. I will provide the code I am currently using just to turn them on and off through the monitor. Any help would be appreciated and it should be a pretty quick solution.
void setup()
{
pinMode(13, OUTPUT);
Serial.begin(9600);
while (!Serial);
Serial.println("Input 1 to Turn LED on and 2 to off");
}
void loop() {
if (Serial.available())
{
int state = Serial.parseInt();
if (state == 1)
{
digitalWrite(13, HIGH);
Serial.println("Command completed LED turned ON");
}
if (state == 2)
{
digitalWrite(13, LOW);
Serial.println("Command completed LED turned OFF");
}
}
}