Thunderborg Autonomous
Forums:
I am trying to set up autonomous driving while using a Thunderborg. How would I call the motors to the code while using thunderborg. I figured I would have to import thunderborg and then call SetMotors. Just confused and was wondering if anyone could help me out. Thanks!!
piborg
Sat, 02/17/2018 - 18:15
Permalink
Simple ThunderBorg code example
This is a stripped down example which should do the minimum needed to setup the ThunderBorg and then command the motors to move for a set period of time:
gmar7
Sat, 02/17/2018 - 19:46
Permalink
So I am using ultrasonic
So I am using ultrasonic sensors to detect if there is an object in a certain amount of distance. I keep getting an error for my code because I am trying to pass the two distance variables to the Movement function to see if it should move forward.
piborg
Sun, 02/18/2018 - 11:29
Permalink
Reading values from a different function
You need to store the values returned from the
UltrasonicSensor1
andUltrasonicSensor2
functions into variables inside theMovement
function itself.For example:
On a second point your
while
loop will need to re-run the distance functions each time if you need the values to be updated after each move.Hopefully that helps you get going :)
gmar7
Sat, 02/24/2018 - 17:07
Permalink
Keeps reading sensors but won't go into autonomous
#Here is what I have so far it seems to just stay in the sensor function and doesn't compare the distance
#If anyone has any idea on how to fix this please let me know
piborg
Mon, 02/26/2018 - 13:10
Permalink
Stuck reading sensors
Looking at your code I presume you are following the guide on the ModMyPi Ultrasonic module page.
If you are not seeing any readings printed then it is likely you are not getting a response from sensor #1. If you see one reading then the problem is related to sensor #2.
Here is a quick list of things to check which may be preventing the sensors from working correctly: