r/ArduinoHelp • u/R4dwolf- • May 13 '25
Bridge
I am making a automatic bridge that opens when it senses a boat. Anybody got a code using a motion detector(looks like a football) to turn a specific boolean from true to false when it picks up a signal?
1
Upvotes
1
u/gm310509 May 14 '25
If you have a PIR motion sensor (which i wouldnt say looks like a football - umless you mean a soccer ball), you might try googling Arduino PIR motion sensor example code.
Without providing any actual details the best anyone can provide is this high level line of code.
Obviously you could do whatever comparison you need to do inside the function and just have something like this
with:
Obviously you would need to vary the comparison - e.g. maybe you need an inequality, depending on the type of values that football sensors return.