Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2015
276
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. CRGB decode(const char *value)
  2. {
  3.   Serial.println(value);
  4.   String svalue = String((char*)value);
  5.   CRGB color;
  6.     color.red = svalue.substring(0,svalue.indexOf(',')).toInt();
  7.     color.green = svalue.substring(svalue.indexOf(',')+1,svalue.lastIndexOf(',')).toInt();
  8.     color.blue = svalue.substring(svalue.lastIndexOf(',')+1).toInt();
  9.  
  10.   return color;
  11. }
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement