#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,16,2);
int LED=3, BUZ=2, PIR=4, DPIR, Freq;
void setup(){
lcd.init();
lcd.backlight();
pinMode(LED,OUTPUT);
pinMode(BUZ,OUTPUT);
pinMode(PIR, INPUT);
}
void Suara(){
for(int Freq=50;Freq<=5000;Freq+=10)
{tone(2,Freq);
delay(50);
noTone(2);}
}
void loop() {
DPIR= digitalRead(PIR);
if(DPIR==1){digitalWrite(LED,1);Suara();lcd.print("roda");}else{digitalWrite(LED,0);lcd.clear();}
}