#define TRIG_PIN 9 #define ECHO_PIN 10 void setup() { Serial.begin(9600); // Start the serial communication pinMode(TRIG_PIN, OUTPUT); // Set TRIG_PIN as an OUTPUT pinMode(ECHO_PIN, INPUT); // Set ECHO_PIN as an INPUT } void loop() { long duration, distance; // Clear the TRIG_PIN digitalWrite(TRIG_PIN, LOW); delayMicroseconds(2); // Set the TRIG_PIN high for 10 microseconds digitalWrite(TRIG_PIN, HIGH); delayMicroseconds(10); digitalWrite(TRIG_PIN, LOW); // Read the ECHO_PIN duration = pulseIn(ECHO_PIN, HIGH); // Calculate the distance in cm distance = duration * 0.034 / 2; // Print the distance to the Serial Monitor Serial.print("Distance: "); Serial.print(distance); Serial.println(" cm"); // Check if the distance is 10 cm if (distance
Nice project and a good idea. But it would be nice if you could send the code too. When I try to click on the link given for code it shows 'PREVIEW NOT AVAILABLE'.
Very nice video I am a Bankar I am a visually impaired person I need a sensor gadget to find my opposite customer For example when the customer standing in front of me our gadget will give a signal I want this type of gadget for me thank you
Heyy! Can you just give us the link of code again actually we need this for our projects and the link u gave is not showing the code so if you can help it would be so kind of you!
Getting access to your code is not easy. One will need permission. As a result, I wouldn't say I like your tutorials. It waist my time. Work on that if not I have to start avoiding your tutorials. OK
Its the same project that we are building rn can you share the coding i am willing to pay budget amount since i am not that rich. plsss gmail me we need it