Tell us about yourself!

Complete Your Profile
  • IoT Air Freshener (with NodeMCU, Arduino, IFTTT and Adafruit.io)

    How to add boolean for PIR section in the below loop.My objective is if the PIR detects the motion it should spray and should reset .Then it should not immediately spray on detecting another motion, instead it should spray after said time and on detecting motion.void loop() { // io.run(); is required for all sketches. // it should always be present at the top of your loop // function. it keeps the client connected to // io.adafruit.com, and processes any incoming data. io.run(); if(digitalRead(BUTTON_PIN) == LOW) { command->save("button"); } else{ long state = digitalRead(13); if(state == HIGH){ digitalWrite (16,HIGH); Serial.println("Motion Detected!"); rotatingPixels(ring.Color(255, 0, 0,0)); // display animation lightPixels(ring.Color...

    see more »

    How to add boolean for PIR section in the below loop.My objective is if the PIR detects the motion it should spray and should reset .Then it should not immediately spray on detecting another motion, instead it should spray after said time and on detecting motion.void loop() { // io.run(); is required for all sketches. // it should always be present at the top of your loop // function. it keeps the client connected to // io.adafruit.com, and processes any incoming data. io.run(); if(digitalRead(BUTTON_PIN) == LOW) { command->save("button"); } else{ long state = digitalRead(13); if(state == HIGH){ digitalWrite (16,HIGH); Serial.println("Motion Detected!"); rotatingPixels(ring.Color(255, 0, 0,0)); // display animation lightPixels(ring.Color(255, 0, 0,0)); // display animation delay(1000); lightPixels(ring.Color(0, 0, 0, 0)); } else { digitalWrite (16,LOW); Serial.println("Motion absent!"); delay(1000); }}}

    View Instructable »
  • IoT Air Freshener (with NodeMCU, Arduino, IFTTT and Adafruit.io)

    Hi,Thanks for the reply and the code.I have altered the code like below and it worked .I will also try your method.io.run(); if(digitalRead(BUTTON_PIN) == LOW) { command->save("button"); } else{ long state = digitalRead(13); if(state == HIGH){ digitalWrite (16,HIGH); Serial.println("Motion Detected!"); rotatingPixels(ring.Color(255, 0, 0,0)); // display animation lightPixels(ring.Color(255, 0, 0,0)); // display animation delay(1000); lightPixels(ring.Color(0, 0, 0, 0)); } else { digitalWrite (16,LOW); Serial.println("Motion absent!"); delay(1000); }}

    View Instructable »
  • SheikM6 followed IgorF21 year ago
      • Joy Robot (Robô Da Alegria) - Open Source 3D Printed, Arduino Powered Robot!
      • IoT Wallet (smart Wallet With Firebeetle ESP32, Arduino IDE and Google Spreadsheet)
      • Wi-Fi Smart Scale (with ESP8266, Arduino IDE, Adafruit.io and IFTTT)