Created
December 20, 2014 12:31
-
-
Save kuronekomichael/c634d429e5a2aee2ed49 to your computer and use it in GitHub Desktop.
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
#include "TrinketFakeUsbSerial.h" | |
void setup() | |
{ | |
TFUSerial.begin(); | |
} | |
void loop() | |
{ | |
TFUSerial.task(); // this should be called at least once every 10 ms | |
if (TFUSerial.available()) { | |
char c = TFUSerial.read(); | |
if (c == 'a') | |
{ | |
TFUSerial.println("hello world"); | |
} | |
else if (c == 'b') | |
{ | |
TFUSerial.println(millis(), DEC); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment