- Get link
- Other Apps
#include <SoftwareSerial.h> #include <LiquidCrystal.h> //LiquidCrystal lcd(7, 6, 5, 4, 3, 2); LiquidCrystal lcd(13, 12, 11, 10, 9, 8); SoftwareSerial mySerial(0,1); #define trigPin 2 #define echoPin 3 #define PIR_sensor 4 #define m11 5 #define m12 6 void setup() { lcd.begin(16, 2); lcd.print(" Garbage "); Serial.println("garbage "); lcd.setCursor(0,1); lcd.print(" Open Close "); Serial.println(" open close"); delay(3000); lcd.clear(); //lcd.print(" "); delay(2000); mySerial.begin(9600); // Setting the baud rate of GSM Module Serial.begin (9600); pinMode(trigPin, OUTPUT); pinMode(echoPin, INPUT); pinMode(m11, OUTPUT); pinMode(m12, OUTPUT); } void loop() { readPIR(); pingDist(); SendMessage(); } void pingDist () { long duration, distance; int max = 80; // Let consider as Height of the Garbage Bin is = 80 cm. float diff, perc; d