Hello.
With the consent of the original author, I modify the program code for my own use (task for school).
I would like to be able to change the status of several LEDs with one SMS. Currently, I need to send separate messages for each diode.
I think commands could be separated by a semicolon ";".
Unfortunately, I do not know how to go about it.
I attach the a piece of code responsible for reading commands from SMS below. Greetings
case NEXT_TXT:
for(int i=0;i<num;i++){
if(buffer[i]=='\r'||buffer[i]=='\n')buffer[i]=0;
}
Serial.print("Wiadomosc: ");
Serial.println(buffer);
if(nr_correct){
if(strcmp(buffer,"WL 10")==0){
digitalWrite(10,HIGH);
}
if(strcmp(buffer,"WYL 10")==0){
digitalWrite(10,LOW);
}
if(strcmp(buffer,"WL 7")==0){
digitalWrite(7,HIGH);
}
if(strcmp(buffer,"WYL 7")==0){
digitalWrite(7,LOW);
}
if(strcmp(buffer,"STATUS")==0){
send_resp=1;//Raport
}
}