Looking for assistance writing some code

Hello,

Being new to this product and still in the process of teaching myself how it all works, is this the forum to ask for help with writing some code. I have written a basic Obstacle Avoidance Vehicle code using using the Bricktronic shield and NXT motors and buttons but would like to convert the buttons to an Ultrasonic sensor. Can anyone help?
Thanks Heaps.

Hi David, welcome to the W&L forum. We can certainly help you write your code, but mostly in terms of sanity-checks and giving advice and suggestions for the different approaches that you can take.

I’d suggest first getting the example code working with the ultrasonic sensor, so that you confirm that your sensor is working correctly. From there, I’d think about the types of information you obtain from the buttons, and how you might obtain that same information from the ultrasonic sensor. That way your core avoidance algorithms don’t need to change, just how the input data is provided. Hope that makes sense, looking forward to a fun conversation about robots! :slight_smile:

Hi Layne and Everyone Else,

Thanks for the response much appreciated. Firstly, taking on board your reply I have checked the Ultrasonic with a simple circuit and its working fine. Secondly, basic operation of the robot will be to detect an obstacle, stop, reverse, turn to a random point and move forward from there. I will continue working on these principles as you suggest. Further background I’m a high school teacher (with limited experience in this area) integrating Arduino and Lego NXT into my classroom as part of the curriculum, so any and all advice is appreciated.

Thanks heaps,
David