I want to compare the received message with string "ON" and "OFF"
and if the message contains ON then set a digital pin high for 30 minutes max and
if OFF is received then set that digital pin Low.
void setup() {
Serial.begin(9600);
delay(3000);
Serial.println("AT+CPMS="ME""); // AT commands for sony T610
delay(3000);
Serial.println("ATE=0"); // ECHO off
delay(3000);
Serial.println("AT+CMGF=1"); //text format
delay(3000);
Serial.println("AT+CMGR=1"); //read text message from the location 1 of the phone
delay(3000);
if (Serial.available() > 0) {
/* Now i cant understand how to assign that
data string received in the form of text message to a memory
locaton on arduino and compare with another string and
then do the appropriate action.*/
/* I want to compare the received message with string "ON" and "OFF"
and if the message contains ON then set a digital pin high for 30 minutes max and
if off is received then set that digital pin Low
*/
}
void loop() {
}
PLEASE HELP ME I GOT STUCK...
testing.pde (869 Bytes)