#include <Bounce2.h>
#define button 6
int offLedPin = 7; //dioda wylaczania alarmu
int buzzerPin = 8; //buzzer alarmowy
int sensorPin = 9; //sensor wody
int stanBuzzer = LOW; //inicjalizacja stanu buzzera
int stanLed = LOW; //inicjalizacja stanu diody
int licznik = 0;
Bounce debouncer = Bounce();
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(buzzerPin, OUTPUT);
pinMode(offLedPin, OUTPUT);
pinMode(sensorPin, INPUT);
pinMode(button, INPUT_PULLUP);
debouncer.attach(button);
debouncer.interval(5);
}
void loop() {
//<---obsluga przycisku
debouncer.update();
int value = debouncer.read();
if(value == LOW){
licznik++;
Serial.println(value);
}
//----> END
if(licznik == 0){
if(digitalRead(sensorPin) == LOW){
digitalWrite(offLedPin, LOW);
digitalWrite(buzzerPin, HIGH);
}
}
if(licznik == 1){
digitalWrite(buzzerPin, LOW);
digitalWrite(offLedPin, HIGH);
}
if(licznik == 2){
licznik = 0;
}
}
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}