GSM Tricker for AirCon

Announcement Date: November 18, 2015

Hi again

well i have the GSM board and my Uno wired up and it works but i need to find a way to talk to the AirCon unit what kind of data it is using..

well it is a project there is on the run so more will be posted here..

here is the code:


#include "SIM900.h"
#include <SoftwareSerial.h>
#include <LiquidCrystal.h>

//If not used, is better to exclude the HTTP library,
//for RAM saving.
//If your sketch reboots itself proprably you have finished,
//your memory available.
//#include "inetGSM.h"

//If you want to use the Arduino functions to manage SMS, uncomment the lines below.
#include "sms.h"
SMSGSM sms;

LiquidCrystal lcd(8, 9, 4, 5, 6, 7);
int backLight = 13;    // pin 13 will control the backlight
int ledpin = 11;
char msg[160];
int numdata;
boolean started=false;
char smsbuffer[160];
char n[12];
int lcd_key = 0;
int adc_key_in = 0;


void setup()
{
      //LCD Setup
      pinMode(backLight, OUTPUT);
      digitalWrite(backLight, HIGH); // turn backlight on. Replace 'HIGH' with 'LOW' to turn it off.
      lcd.begin(16,2); // columns, rows.  use 16,2 for a 16x2 LCD, etc.
      lcd.print("Starting up");  // start with a "blank screen"
      // Tricker setup
      pinMode(ledpin,   OUTPUT);
      
     //Serial connection.
     Serial.begin(9600);
     Serial.println("GSM Shield testing.");
     //Start configuration of shield with baudrate.
     //For http uses is raccomanded to use 4800 or slower.
     if (gsm.begin(9600)) {
          lcd.setCursor(0,0);           // set cursor to column 0, row 0 (the first row)
          lcd.print("READY");
          Serial.println("\nstatus=READY");
          started=true;
     } else Serial.println("\nstatus=IDLE");
            lcd.setCursor(0,0);           // set cursor to column 0, row 0 (the first row)
            lcd.print("READY");

     if(started) {
          //Enable this two lines if you want to send an SMS.
          //if (sms.SendSMS("4040xxxx", "Arduino SMS"))
          Serial.println("Ready To Send");
          lcd.setCursor(0,0);           // set cursor to column 0, row 0 (the first row)
          lcd.print("Ready to send");
     }
}

void loop()
{
     //lcd.setCursor(9,1); // place cursor
     //lcd.print(millis()/1000); // display seconds 
     lcd.setCursor(0,1); // move cursor
     lcd_key = analogRead(0); // read the buttons

     if (lcd_key<50){
        if(started) {
          //Enable this two lines if you want to send an SMS.
          if (sms.SendSMS("4040xxxx", "Button Right"))
          Serial.println("\nSMS sent OK");
          lcd.setCursor(0,0);           // set cursor to column 0, row 1 (the first row)
          lcd.print("Ready to send");
          lcd.setCursor(0,1);           // set cursor to column 0, row 1 (the first row)
          lcd.print("SMS sent OK");
      
     }
     } 
     else if (lcd_key<250){
        if(started) {
          //Enable this two lines if you want to send an SMS.
          if (sms.SendSMS("4040xxxx", "Button UP"))
          Serial.println("\nSMS sent OK");
          lcd.setCursor(0,0);           // set cursor to column 0, row 0 (the first row)
          lcd.print("Ready to send");
          lcd.setCursor(0,1);           // set cursor to column 0, row 1 (the first row)
          lcd.print("SMS sent OK");
      
     }
     } 
     else if (lcd_key<450)
     {
     
               lcd.setCursor(0,0);           // set cursor to column 0, row 1 (the first row)
               lcd.print("Ready to send");
               lcd.setCursor(0,1);           // set cursor to column 0, row 1 (the first row)
               lcd.print("                ");         
     }
     else if (lcd_key>550)
     {
     if(started) {
          //Read if there are messages on SIM card and print them.
          if(gsm.readSMS(smsbuffer,160,n,12)) {
               Serial.println(n);
               Serial.println(smsbuffer);
               lcd.setCursor(0,0);           // set cursor to column 0, row 1 (the first row)
               lcd.print("                 ");
               lcd.setCursor(0,0);           // set cursor to column 0, row 1 (the first row)
               lcd.print(n);
               lcd.setCursor(0,1);           // set cursor to column 0, row 1 (the first row)
               lcd.print(smsbuffer);
               
              
          }
           if(gsm.readSMS(smsbuffer,160,n,12) == 'On, +454040xxxx')
            {
              Serial.println("led on");
              analogWrite(ledpin, 255);  
            }
            }        
          delay(1000);
            }
     }