Created
July 13, 2016 15:57
-
-
Save thomasdenney/95b9c4c4737e4dbe79214295dcd36314 to your computer and use it in GitHub Desktop.
Simple echo over serial for PuTTY and micro:bit
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 "MicroBit.h" | |
MicroBit uBit; | |
int main() | |
{ | |
uBit.init(); | |
while (true) { | |
uBit.serial.send("What is your name?\r\n"); | |
ManagedString answer = uBit.serial.readUntil("\r"); | |
uBit.serial.send("Hello, "); | |
uBit.serial.send(answer); | |
uBit.serial.send("\r\n"); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment