Closed ghost closed 2 years ago
Even if the second issue I linked above is very similar to my question, apparently I solved removing the sequence.
The JLedSequence
sequence
object has a state and in your setup, the sequence is in state "not running", because both JLed
objects are already/initially Off
. So further calls to sequence.Update()
will have no effect. Try to call sequence.Reset()
in your ProcessLine
function.
Also the pinMode
and digitalWrite
calls are not needed, since already handled by JLed
Great thanks. Is there any advantage to use a parallel sequence
instead of handling both JLed
objects separately (i.e. calling .Update()
for each one) ?
No, the JLedSequence
is just for convenience if you have e.g. 10 LEDs to update
I read other similar questions like this and this. I'm testing this code on an Arduino Leonardo:
I'm expecting it begins blinking whenever it receives something on the serial line. The "done" message is printed out. But the LED remains off. Instead, if I uncomment the line in
setup()
it begins blinking after the serial port is open.Where is my mistake here?