Firstly make sure your Distance sensor is working. If you look on the App screen, when you are connected to the robot, you should be able to see a reading from the Distance Sensor. Move your hand in front of to it and the value should change.
So why might it still not be working?
Wrong Port - make sure that you the Port you have the Distance sensor plugged into is the Port you have referenced in the code.
Wrong value - make sure the value you have put in the code is cms. And, really important, make sure that it is no lower than 5/6 cms. Below this your robot will struggle to sense objects.
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article