|
Edited by 1559507739 at 2019-6-5 09:47 AM
Oh, and if anyone runs into the same issue which I outlined above; congratulations, you are as stupid as me! Haha. My power and motor cables were swapped, meaning I plugged them into the others slot on the Motor Hat. Also, after I fixed that I noticed the controls were all backward. I remembered seeing a reversed build somewhere, but couldn't find it.
So here's how to fix that, ssh into your Pi and navigate to the adeept directory created during initial setup. Navigate to the server directory and open the turn.py file with nano, vi, or whatever you would like. Find the following lines: def right and def left, then swap their values as shown here turn_right_max > turn_left_max, then do the same for the other, so both right and left are reversed then make sure to save the file. Next, open motor.py and find def motor_right and def motor_left, now look for "GPIO.output," then reverse the following below for both Dir_forward and Dir_backward on both motor_right and left!
GPIO.output(Motor_B_Pin1, GPIO.HIGH) >> GPIO.output(Motor_B_Pin1, GPIO.LOW)
GPIO.output(Motor_B_Pin2, GPIO.LOW) >> GPIO.output(Motor_B_Pin2, GPIO.HIGH)
Then reverse the following (e.g., if forward says 0, make it 1, etc.):
Dir_forward =
Dir_backward =
Save the file and reboot or reload the server!
Now I just need to work on strengthing the front steering column for the servo, so it does not veer to the right every time I move forward... |
|