Pages: [1]   Go Down
Author Topic: arduino program code +gsm for industrial automation.HELP NEEDED  (Read 1209 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello again my arduino friends!! According to a library i found i've written a code for a simple project. All i need is : in an industrial board when the power is off,arduino sends a message to the user that warns him that the power is off. I want you to see the code and tell me if is correct or not. I use a library that i found in Internet for the gsm sim900.
The code is:

#include "SIM900.h"
#include <SoftwareSerial.h>
#include "sms.h"
SMSGSM sms;
boolean started=false;
int board1 = 7;

void setup()
{
  //Serial connection.
  Serial.begin(9600);
  pinMode(board1, INPUT);
  Serial.println("GSM Shield testing.");

  if (gsm.begin(2400)){
    Serial.println("\nstatus=READY");
    started=true; 
  }
  else Serial.println("\nstatus=IDLE");
 
  if(started){
    if (sms.SendSMS("+30693xxxxxxx", "SMS from Arduino OK."))
      Serial.println("\nSMS sent OK");
  }

};


void loop()
{
int buttonState = digitalRead(board1);
if (board1=LOW)
sms.SendSMS("+306932xxxxxxx", "board1 is off");


}



Can anybody please tell me if is the code correct??If not what can i change so it will work properly??I think it is a simple project but my programming skill is low cause i am a beginner. Thank you in advance.     smiley smiley smiley
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I join you in this question.

Actually I have the same problem. I´m just starting with an Arduino UNO and I want to do exactly this. After this is working, I would like to:

1- Add and TFT touch screen
2- Write the warm in the SD card

Can somebody help us?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 33
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi, the loop might send an sms, but there is no end of the sms as it continously loops over and over again. Thus you would send a string of sms as long as the signal is low...

If your planning to sell the thing I could help you out on a commercial basis as I do this kind of things for a living, but otherwise I suggest going to local hackerspace as it is rather trivial for someone who has done it before, but requires a lot of reading and testing for a beginner and getting the help of a real person is usually much more fun!

Logged

Pages: [1]   Go Up
Jump to: