Hi all , im busy with sim 800l module , i have the module working and can send and recieve sms. I want to change the senders number in the code via serial terminal. i have a basic sketch writen but i cant get it to work. Ï also tried to save the "readString " to eeprom but had no luck with that to. Can any one please help with this problem, I also searched the net for a solution but got more confused
Thanks
#include <SoftwareSerial.h>
#include <EEPROM.h>
#include <Sim800l.h>
Sim800l Sim800l;
String readString;
int addr = 0;
char* text;
char* number;
bool error; //to catch the response of sendSms
String val =readString;
void setup()
{
Sim800l.begin();
Serial.begin(9600);
while (!Serial.available())
{
Serial.println("Type Cellphone number and press enter");
delay (500);
}
while (Serial.available()) {
char c = Serial.read(); //gets one byte from serial buffer
readString += c; //makes the string readString
delay(2); //slow looping to allow buffer to fill with next character
}
if (readString.length() > 0) {
Serial.print(readString);
}
readString=""; //empty for next input
}
void loop()
{
text="test"; //text for the message.
number= readString; //change to a valid number.
error=Sim800l.sendSms(number,text);
delay(2000);
Serial.flush();
delay(55000);
}