thegasman2000
New member
Yeah == true would have been an awful lot easier but as they are different types its a no go... You did however get me googling the right things! I think (will test with the leds attached tomorrow) I have it working as intended. The code is
for anyone interested. I will test and if it works as intended I will link the whole thing once I have tidied it all up and commented it as required.
I also picked up a used MarsAqua LED 165w with the dimmer knobs on top. I will be adding that and will show the wiring when I have it buttoned up. Its different and requires a transistor on each channel but nice and easy to do
Code:
String requestString = String(request);
int indexPosition = requestString.indexOf('?');
if (requestString.charAt(indexPosition + 1) == 'W') {
requestString = requestString.substring(12, 16);
whiteLevel = requestString.toInt();
Serial.println("White LEVEL SET TO = ");
Serial.println(whiteLevel);
analogWrite(whiteLedPin, whiteLevel);
}
if (requestString.charAt(indexPosition + 1) == 'B') {
requestString = requestString.substring(11, 15);
blueLevel = requestString.toInt();
Serial.println("BLUE LEVEL SET TO = ");
Serial.println(blueLevel);
analogWrite(blueLedPin, blueLevel);
}
for anyone interested. I will test and if it works as intended I will link the whole thing once I have tidied it all up and commented it as required.
I also picked up a used MarsAqua LED 165w with the dimmer knobs on top. I will be adding that and will show the wiring when I have it buttoned up. Its different and requires a transistor on each channel but nice and easy to do
Last edited: