Skip to content

Instantly share code, notes, and snippets.

@thomasdenney
Created July 13, 2016 15:57
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 thomasdenney/95b9c4c4737e4dbe79214295dcd36314 to your computer and use it in GitHub Desktop.
Save thomasdenney/95b9c4c4737e4dbe79214295dcd36314 to your computer and use it in GitHub Desktop.
Simple echo over serial for PuTTY and micro:bit
#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