#include <SoftwareSerial.h>
SoftwareSerial sim800L(2, 3);
SoftwareSerial neo6m(6, 7);
const uint8_t motionPin = 13;
const uint8_t button_VIN = 9;
const uint8_t button_VOUT = 11;
const uint8_t servo = 5;
int IRsensor = 13;
int ledred = 6;
int ledgreen = 7;
double buzzPin = 12;
#define ADC_VREF_mV 5000.0 // in millivolt
#define ADC_RESOLUTION 1024.0
#define PIN_LM35 A0
void setup() {
Serial.begin(9600);
pinMode(A0, INPUT);
pinMode(7,OUTPUT );
pinMode(PIN_LM35, INPUT);
pinMode(buzzPin, OUTPUT);
pinMode(12, OUTPUT);
sim800L.begin(9600);
neo6m.begin(9600);
// put your setup code here, to run once:
}
void loop() {
int x = analogRead(A0);
float temp = (x*4.88) / 10;
if(temp>30)
{digitalWrite(6, HIGH);
digitalWrite(7, LOW);
tone(buzzPin,500);
}
else{
digitalWrite(6,LOW);
digitalWrite(7,HIGH);
tone(buzzPin,0);
Serial.print("Temperature: ");
Serial.print(temp);
delay(2000); }
}