Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int measuredDistance;
- int distanceThreshold = 1; // 1 meter
- void * sensor_thread(void * threadid) {
- // measure distance
- // update measuredDistance
- }
- int main () {
- while(1){
- // do image processing
- if (measuredDistance < distanceThreshold)
- stopTheCar();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement