Hi there,
I’ve not gotten buch luck with getting ArtNet working, so am falling back onto the original plan, the Cloud API.
I’ve found the Simple-Spark-Core-Controller (which I believe @BDub put together) to be extremely helpful, and can get it successfully talking to the
I was hoping I could go one step further – rather than having to have duplicate functions reside on the Spark Firmware, I was hoping to be have code on the Firmware which receives three values, separated by commas, and then writes these values to an output.
ie: 098,183,204
would get parsed and send value 098 to A5, 183 to A6, and 204 to A7.
Here’s the code I’ve got so far, but it’s not doing what I want. I’ve tested it and it just seems to grab the integer in its physical location instead of its CSV grouping.
int rgbstrip(String command)
{
// Convert received string to RGB values
String r = command.substring(1);
int rval = r.toInt();
String g = command.substring(2);
int gval = g.toInt();
String b = command.substring(3);
int bval = b.toInt();
// Write values to outputs
analogWrite(red, rval);
analogWrite(green, gval);
analogWrite(blue, bval);
// Return response
return 1;
}
Any advice would be appreciated
(Once I’ve got this working, I just need to figure out how to get the value to “fade”. For example, if the value on a pin started at 200 and needs to get to 10, I want it to gradually dim. If anyone has a lightweight way of doing this, I’d also be interested to know.)