arduino - NodeMCU MQTT RGB Led control -
i want control adafruit color picker rgb led. code this: string value = (char *)rgbled.lastread; //from adafruit color picker string red = value.substring(1, 3); string green = value.substring(3, 5); string blue = value.substring(5, 7); red.tochararray(charbuff, 1); green.tochararray(charbuff, 1); blue.tochararray(charbuff, 1); long r_val = strtol(red, null, 16); long g_val = strtol(green, null, 16); long b_val = strtol(blue, null, 16); please me this. unable convert hex color code respective rgb values.