#include <LiquidCrystal.h> //Include LCD library
#include <GSM.h> // Include the GSM library
#include <SoftwareSerial.h>
SoftwareSerial mySerial(9, 10); // RX,TX
LiquidCrystal lcd(12, 11, 5, 4, 3, 2); // initialize the library with the numbers of the interface pins
GSM gsmAccess; // initialize the library instance
GSM_SMS sms;
void SetAlert()
{
int sms_count = 1;
float Fire_Set;
while (sms_count < 3) //Number of SMS Alerts to be sent
{
SendTextMessage(); // Function to send AT Commands to GSM module
}
Fire_Set = 1;
lcd.setCursor(0, 1);
lcd.print("Gas Alert!SMS Sent");
}
void SendTextMessage()
{
int sms_count;
mySerial.println("AT+CMGF=1"); //To send SMS in Text Mode
delay(2000);
mySerial.println("AT+CMGS="+96171797525"\r"); // change to the phone number you using
delay(2000);
mySerial.println("GAS IN THE KITCHEN HURRY UP");//the content of the message
delay(200);
mySerial.println((char)50);//the stopping character
delay(5000);
sms_count++;
}
int potPin = A4;
int potValue = 0;
int buzzer = 6;
int sms_count = 0;
void setup() {
lcd.begin(16, 2); // lcd rows and columns
lcd.print("GAS SENSOR");
pinMode(6, OUTPUT);
mySerial.begin(9600);
Serial.begin(9600);
lcd.begin(16, 2);
delay(500);
}
void loop() {
potValue = analogRead(potPin);
lcd.setCursor(0, 1);
lcd.print("Value = ");
lcd.print(potValue);
delay(1000);
lcd.print(" ");
delay(1);
if (potValue > 200)
{
SetAlert(); // Function to send SMS Alerts
digitalWrite(6, HIGH); // 6 is the digital pin on arduino connected to buzzer
delay(100);
}
}
i got this error