Skip to content

Instantly share code, notes, and snippets.

@towynlin
Created October 29, 2014 23:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save towynlin/d8b4593201511310cf00 to your computer and use it in GitHub Desktop.
Save towynlin/d8b4593201511310cf00 to your computer and use it in GitHub Desktop.
Quick Spark test app for sending binary to a Spark.function
int binaryToSerial(String s) {
int len = s.length();
for (int i=0; i < len; i++) {
Serial.write(s[i]);
Serial.write(' ');
Serial.println(s[i], HEX);
}
return len;
}
void setup() {
Serial.begin(115200);
Spark.function("binary", binaryToSerial);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment