// Respond to simple serial commands: "mode 1", "mode 0" void handleSerial() if(Serial.available()) String s = Serial.readStringUntil('\n'); s.trim(); if(s.startsWith("mode")) int m = s.substring(5).toInt(); mode = constrain(m, 0, 2); applyMode(mode); Serial.print("Mode set to "); Serial.println(mode);
void applyColor(RGB col) analogWrite(R_PIN, col.r); analogWrite(G_PIN, col.g); analogWrite(B_PIN, col.b); arduino magix patched
She swirled her index finger clockwise. The lamp brightened. Counterclockwise? It dimmed into a warm sunset orange. She snapped her fingers—the lamp cycled through a rainbow wave. // Respond to simple serial commands: "mode 1",