Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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