-
-
Save burakaydn/6a6914698d41811186cd to your computer and use it in GitHub Desktop.
Arduino softmodem sketch
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 <SoftModem.h> | |
#include <ctype.h> | |
SoftModem modem; | |
void setup() | |
{ | |
Serial.begin(1225); | |
delay(1000); | |
modem.begin(); | |
} | |
void loop() { | |
while(modem.available()){ | |
int c = modem.read(); | |
if (isprint(c)) { | |
Serial.print("Read CHR("); | |
Serial.print((char)c); | |
Serial.println(")"); | |
} else { | |
Serial.print("Read HEX("); | |
Serial.print(c,HEX); | |
Serial.println(")"); | |
} | |
} | |
if(Serial.available()){ | |
modem.write(0xff); | |
while(Serial.available()) { | |
char c = Serial.read(); | |
modem.write(c); | |
// Serial.print("Write CHR("); | |
// Serial.print(c); | |
// Serial.println(")"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment