Ultrasonic Sensor to have two codes?

I will be making a robot that can follow a white line in a maze and I was thinking of using Ultrasonic sensor HC-SR04 to use for detecting the walls (dead end) too, is it possible to teach one ultrasonic with two command?

Can you rephrase that, please?

Do you mean the HC-04?

yeahh, sorry I made a mistake

With one ultrasonic, is it okay that it read two different distance? Like it will read the distance of an obstacle from 5cm and 6cm ?

Typically, they will return only the first echo timing.

There are some I2C devices (Devantech?) that will return multiple ranges.

If you want to do something cool. You can mount the ultrasonic sensor on a tiny servo and scan back and forth.
It will give you a crude 1 dimentional scan of what is in front of you.

@makkkks It was solved by @anon56112670 NOT me

Yeah its goo idea..As well if you need something new try this tool as well.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.