How to constantly read a sensor value in the background while doing other action


i'm using ultrasonic sensor , it's long sensor value below threshhold, run motors. how can program arduino read values sensor , check if it's passed threshhold or not in background? have interrupts?

nope.  have write loop function doesn't use delay or other blocking functions.  when loop set right, looks checklist.  program can spin through entire loop in matter of milliseconds.

have @ thread example code doing several things @ once:
https://forum.arduino.cc/index.php?topic=223286.0


Arduino Forum > Using Arduino > Programming Questions > How to constantly read a sensor value in the background while doing other action


arduino

Comments