Hi there,
I am trying to extend the line sensor program to include the ultrasound distance detector. I force the car to stop when the ultrasound read something too close ahead. The code is as follow
If I use the “When FLAG clicked” event trigger, it works: I mean the car wheel stop when I put my hand close to the ultrasound sensor, I also try to show the ultrasound reading, it changes when I place obstacle at different distance. However, the same code when I replace the “When FLAG clicked” with mBot program and burn it to the mBot in Arduno mode. The ultrasound sensor never works. The car keeps going and never stop even I have my hand in front of the car in 5 cm. If it even odd, the car keep moving forward, seems that the line follower doesn’t work either.
p.s. if I place my hand to block the ultrasound sensor before my turning the power on, after the power is connected, the car wheel stop until I put my hand away. Very strange.