Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#include <Arduino.h>
int getChar(FILE *fp) {
while (!(Serial.available()))
;
return (Serial.read());
}
int putChar(char c, FILE *fp) {
if (c == '\n') {
putChar((char)'\r', fp);
}
Serial.write(c);
return 0;
}
void setup() {
Serial.begin(9600);
fdevopen(putChar, getChar);
printf("Hello %s!", "there")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.