Pages: [1]   Go Down
Author Topic: Control water pump through sms using a old sony phone interfaced with arduino  (Read 1637 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 (0.85 KB - downloaded 2 times.)
Logged

0
Offline Offline
Shannon Member
****
Karma: 161
Posts: 10434
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

How about using NewSoftSerial to interface to the phone and then the normal Serial library can be used to debug via USB so you can see what's coming from the phone?
Logged

[ I won't respond to messages, use the forum please ]

Pages: [1]   Go Up
Jump to: