and now you can play with sliders
void rgb() {
if (btnState == true) {
time1 = millis();
redVal = 128 + 127 * cos(2 * PI / period * (Speed-time1));
greenVal = 128 + 127 * cos(2 * PI / period * (offset+Speed - time1));
blueVal = 128 + 127 * cos(2 * PI / period * (offset2+Speed - time1));
red.setValue(redVal);
green.setValue(greenVal);
blue.setValue(blueVal);
}
}
BLYNK_WRITE(V28) { //slider
period = param.asInt();
}
BLYNK_WRITE(V29) { //slider
Speed = param.asInt();
}