Hi Friends,
I am new in arduino world and i have a question in using if loop.
Actually I am working with small project include GSM module , my question is how to use the received message in loop to make action such as output activation.
Thanks.
Hi Friends,
I am new in arduino world and i have a question in using if loop.
Actually I am working with small project include GSM module , my question is how to use the received message in loop to make action such as output activation.
Thanks.
What have you done so far ? Have you been able to receive a message and see it on the serial monitor ?
Please post your code that we can give advice.
To be pedantic, an if statement does not loop. while statements and for statements loop.
Thanks friends I will go to more easy task which is send sms XD XD , and absolutely i will need your help .
friends,
I have ARDUINO Mega 2560 and SIEMENS TC 35 , and I try to send SMS .
I found some codes such as
/*
Application Name: Arduino Send SMS
Description: Send SMS messages using a Motorola C168i
Author: Jeff Murchison
Contact: jeff@jeffmurchison.com
Date: September 17, 2012
Version: 1.0
License:
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
http://creativecommons.org/licenses/by-nc-sa/3.0/
Attributions / Special Thanks:
*/
#include <SoftwareSerial.h>
SoftwareSerial mySerial(3, 2); // RX, TX pins
void setup() {
pinMode(13, OUTPUT); // Initialize pin 13 as digital out (LED)
pinMode(8, INPUT); // Our button pin
mySerial.begin(4800); // Open serial connection at baud rate of 4800
}
void loop(){
if (digitalRead(8) == HIGH){ // On button press
digitalWrite(13, HIGH); // Turn LED on.
mySerial.println("AT"); // Sends AT command to wake up cell phone
delay(500);
mySerial.println("AT+CMGF=1"); // Puts phone into SMS mode
delay(1000); // Wait a second
mySerial.println("AT+CMGW="+14165551234""); // YOUR NUMBER HERE; Creates new message to number
delay(1000);
mySerial.print("Sent from my Arduino."); // Message contents
delay(1000);
mySerial.write(byte(26)); // (signals end of message)
delay(1000);
mySerial.println("AT+CMSS=1"); // Sends message at index of 1
digitalWrite(13, LOW); // Turn LED off
delay(250);
digitalWrite(13, HIGH); // Turn LED on.
delay(10000); // Give the phone time to send the SMS
mySerial.println("AT+CMGD=1"); // Deletes message at index of 1
digitalWrite(13, LOW); // Turn LED off.
delay(250);
}
}
My question is :
Can i use this code and the same instruction such as
(mySerial.println("AT+CMGW="+14165551234""); // YOUR NUMBER HERE; Creates new message to number)
on TC35 GSM module , if no what is the instructions should i use?
Thanks for all.