You can now import the brickpi3 module on your own computer!


#1

Currently I can only test my code on the robot itself, but what if I could write code for the robot and run the code on my laptop? That is exactly what I just did and here is how.

So first I took the brickpi3.py and went through every function and replaced it’s contents with a simple pass This means I can call let’s say `BP.reset_all() without any errors because it is doing absolutely nothing. Why is this useful? It basically let’s me run code written for the robot on my computer without any hardware errors. Also if you ask for sensor readings it will give just a static reading identical to what you would normally find. I am going to implement in the future random readings, and the ability to load datasets for it to return sensor readings from.

You can find this on github:
BrickedPi3_Dev
I haven’t got it to work on windows yet, but it works fine on linux and should work on MacOS. If there are any issues feel free to contact me or if you are on github just make an issue!

I am sharing this because I hope this will be useful to others. Again this isn’t quite complete, so more improvements are coming. New features are always welcome.

Please note this is in the Beta so there are likely to be many bugs.