简体   繁体   中英

PIR sensor output doesn't respond to the expectation

When uploading the PIR sensor to arduino mega board , it gives a output which is opposite to the expectation in the code! Instead of turning the light on when a motion is detected, its turns it off. And it's comes on again when there is no motion detected! What could be the problem? Need help

Check if the pinMode is set to INPUT or INPUT_PULLUP. In INPUT_PULLUP mode you will receive opposite states. It will return LOW when input is HIGH.
For more help post your code.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM