BrickPi robot program ideas


I got my BrickPi and I have the Lego Mindstorms EV3 Home kit. I want to make a robot where if it gets close to a wall, it stops, turns 90 degrees to the side (doesn’t matter if its right or left) and then drive forward again. I have done this using the EV3-G programming software, but when I tried to do it in Python for the BrickPi, it wouldn’t work. I am new to BrickPi_Python and I wanted to see if somebody could help me get started with a simple program. I didn’t find any BrickPi_Python tutorials online that go in-depth.


Attached is some Python code that we use for testing our robots in the classroom. Hope you find it easy to adapt to your configuration.



Trying to attach the code as a zip file…

Thank you so much! I haven’t tried the program yet, but I will as soon as I get the chance! Again, thank you for putting your time in and helping me out.

I saw the program you wrote and is there a way to use infrared sensor instead of ultrasonic sensor? I have the Lego Mindstorms EV3 home kit, which includes an infrared sensor, not ultrasonic sensor. I don’t want to go out and buy the Lego ultrasonic sensor.

I have only tried NXT sensors, but you could surely check this code from Dexter repository:

Good luck!

Thanks. I’ll try to modify the code to work with the EV3 infrared sensor.