Created
February 15, 2020 07:07
-
-
Save an-dr/280aa9cfe963d02fc7d877b24becd274 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 <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