Professional Documents
Culture Documents
void setup() {
void loop(){
if (state == LOW) {
Serial.println("Motion detected!");
state = HIGH; // update variable state to HIGH
else {
if (state == HIGH){
Serial.println("Motion stopped!");