Created
October 29, 2014 23:46
-
-
Save towynlin/d8b4593201511310cf00 to your computer and use it in GitHub Desktop.
Quick Spark test app for sending binary to a Spark.function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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