// include the GSM library
#include <GSM.h>
// initialize the library instances
GSM gsmAccess;
GSM_SMS sms;
int led = 13; //pin 13
char inchar;
void setup()
{
// initialize serial communications and wait for port to open:
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}
pinMode(13, OUTPUT);
digitalWrite(13, LOW);
Serial.println("SMS Messages Receiver");
}
void loop()
{
// If there are any SMSs available()
if (sms.available())
{
inchar=Serial.read();
{ if(inchar = "ledon"){
digitalWrite(13, HIGH);}
if(inchar = "ledoff"){
digitalWrite(13, LOW);}
// Delete message from modem memory
sms.flush();
Serial.println("MESSAGE DELETED");
}
delay(1000);
}
}
I'm trying to control an LED using Arduino by using SMS.
And I get this error: invalid conversion from 'const char*' to 'char'.
So I need help to correct my coding please. v.v