How can I assign an RGB hex value to a Neopixel LED strip that I have? This is the code that I have:
Code: Select all
String HexInput = "0x";
while (Serial.available() > 0) {
HexInput += Serial.read();
delay(5);
}
colorWipe(HexInput, 25);
However I get errors saying I can't use String in place of an uint_32. So I tried several ways to if I can convert a string to an uint_32 but couldn't find anything that worked. So I changed my code,
Code: Select all
uint32_t HexInput = '0x';
while (Serial.available() > 0) {
HexInput += Serial.read();
delay(5);
}
colorWipe(HexInput, 25);
Except now I get weird outputs for HexInput such as if the input is bank 12408, or 12804 when I try inputting 00ff00. How can I input an RGB hex as a colour for a neopixel?
Thanks.