Skip to content

Instantly share code, notes, and snippets.

@dmiddlecamp
Created January 20, 2015 20:17
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dmiddlecamp/04c6f0591c736f12f710 to your computer and use it in GitHub Desktop.
Save dmiddlecamp/04c6f0591c736f12f710 to your computer and use it in GitHub Desktop.
Sample Spark.function 'nyan' / rainbow firmware!
void setup() {
Spark.function("nyan", nyanHandler);
}
void loop() {
//nothing to see here!
}
int nyanHandler(String cmd) {
if (cmd == "on") {
Spark_Signal(true);
}
else if (cmd == "off") {
Spark_Signal(false);
}
}
@dmiddlecamp
Copy link
Author

Copy and paste this code into https://www.spark.io/build/ and flash it to your Spark Photon or Spark Core! :)

@rymo
Copy link

rymo commented Aug 4, 2015

is there documentation somewhere for Spark_Signal? this doesn't compile for me:

error: too few arguments to function 'void Spark_Signal(bool, unsigned int, void*)'

@thathollywood
Copy link

Doesn't compile. Are there missing files?

@sharlee
Copy link

sharlee commented Mar 26, 2016

Can confirm doesn't compile. Pls fix this as it is linked from Particle's page: https://ifttt.com/recipes/244520-when-there-is-a-new-top-post-on-reddit-shout-rainbows

@Tekee
Copy link

Tekee commented Mar 21, 2018

Does anyone know why this coding doesn't work anymore?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment