so I need to turn a sequence of characters into one string, here's my current code
#include <SoftwareSerial.h>
SoftwareSerial SIM900(7, 8);
//Variable to save incoming SMS characters
char incoming_char=0;
void setup() {
- // Arduino communicates with SIM900 GSM shield at a baud rate of 19200*
- // Make sure that corresponds to the baud rate of your module*
- SIM900.begin(19200);*
- // For serial monitor*
- Serial.begin(19200);*
- // Give time to your GSM shield log on to network*
- delay(20000);*
- // AT command to set SIM900 to SMS mode*
- SIM900.print("AT+CMGF=1\r");*
- delay(100);*
- // Set module to send SMS data to serial out upon receipt*
- SIM900.print("AT+CNMI=2,2,0,0,0\r");*
- delay(100);*
- Serial.println("READY...");*
}
void loop() { - // Display any text that the GSM shield sends out on the serial monitor*
- if(SIM900.available() >0) {*
- //Get the character from the cellular serial port*
- incoming_char=SIM900.read();*
- //Print the incoming character to the terminal*
- Serial.println(incoming_char);*
- }*
}
incoming_changes with each loop to form a message but I need it to be one string do you have any idea on how I could do this?
thank you very much in advance