Skip to content

Instantly share code, notes, and snippets.

@dwblair
Last active September 12, 2016 18:29
Show Gist options
  • Save dwblair/08c50c047951a15cad47a17bb4d34ced to your computer and use it in GitHub Desktop.
Save dwblair/08c50c047951a15cad47a17bb4d34ced to your computer and use it in GitHub Desktop.
#include <SoftModem.h>
SoftModem modem = SoftModem();
void setup() {
Serial.begin(9600);
Serial.println("Booting");
delay(100);
modem.begin();
}
int a;
void loop() {
a = analogRead(A0);
String str=String(a);
int str_len = str.length() + 1;
// Prepare the character array (the buffer)
char char_array[str_len];
// Copy it over
str.toCharArray(char_array, str_len);
Serial.println(char_array);
modem.write(char_array, str_len);
//a=a+1; // wraps at 32000
delay(100); // 50 is too fast
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment