Man, oh man!!
Almost there adafruit_support_bill !!
It is now acknowledging the button press!!! :-) <3
The button press triggers the rainbow cycle to start over from the beginning of the rainbowcycle,
but does not revert to one of the other patterns.
Do I add a line in there about the animation pattern in the rainbow section or in the serial read section?
or maybe at the serial.print? (I don't use the term print anywhere else in my code.)
I uncommented the lines I tried, that compiled fine, but did not work.
- Code: Select all | TOGGLE FULL SIZE
digitalWrite(CTS_PIN, LOW); // Signal to BLE, OK to send data!
for (;;) {
t = micros(); // Current time
if ((t - prevTime) >= (1000000L / FPS)) { // 1/30 sec elapsed?
prevTime = t;
break; // Yes, go update LEDs
} // otherwise...
if ((c = ser.read()) == '!') { // Received UART app input?
while ((c = ser.read()) < 0); // Yes, wait for command byte
if (ser.available()> 0) {
c = ser.read();
//pixels.clear ();
ser.print(c);
//ser.print(animMode);
//pixels.clear ();
// switch (animMode);
}
- Code: Select all | TOGGLE FULL SIZE
{
uint16_t i, j;
for(j=0; j<256; j++) { // cycles of all colors on wheel
for(i=0; i< pixels.numPixels(); i++) {
if (ser.available()>0)
{
return;
// pixels.clear ();
// switch (animMode);
}
pixels.setPixelColor(i, Wheel(((i * 256 / pixels.numPixels()) + j) & 255));
}
pixels.show();
}
}
break;