I used two ultrasonic sensors and I want to compare their measured distance to activate the servo motor. The error says too few arguments to function long int readUltrasonicDistance(int, int) and I already searched in google but none of is the same with my error and i do some changes on it but still the ..
I’m using an HC-SR04 Ultrasonic Sensor that displays distance, there’s two if statements, if it’s below 0 it comes out as 0 (that part works as intended), if it’s over 4 meters (distance variable is a centimeter) it is supposed to say "Out of range", and that’s the part I’m having an issue with. Here’s ..
So here’s what I am trying to achieve when the ultrasonic sensor detects a distance less than a certain amount then the light should turn green allowing the traffic to move Here’s the code int pir = 2; int rojo = 12; int amarillo = 11; int verde = 10; int led = 3; const ..