
PRO
jstarne1
USA
Asked
— Edited

OK so I get to ask a question I have tried several variations and I have forward and reverse but left and right are inversed. I click right turn it turns left. Here's my arrangement can someone tell me what to switch so forward and reverse are still correct as well as right and left?
Read through this without reading the last part and see if you can figure out where you went wrong before I finish explaining it
From the topic I linked to;
Code:
So to use that on the robot, setting digital to on (1) and off (0) as follows
Code:
So look at the truth table. Look at what you can change to keep the highs and lows on Forward and Reverse the same. It may be easier if you looked at it like this. This is what you currently have;
Code:
Now if Left turns right and right turns left but forward is OK and reverse is OK. What can change for D2 and D3 to remain high and D1 and D4 low on forward, D2 and D3 to remain low and D1 and D4 high on reverse but change the left and right turn highs and lows? In the above table you can only change the D4, D3, D1 and D2 parts, the highs and lows for the functions must stay the same, they are fixed.
You need to swap left and right motors over so that when turning left the right motor moves reverse and the left moves in forwards. Turning left the right motor moves forwards and the left moves reverse.
We know forward and reverse are OK so that means the right and left motors left hand columns must be either D4 or D1. Reverse is OK too so the right and left motors right hand columns must be D3 or D2. Left and right are backwards so we know that we have to change something. If the right and left motors have the correct polarity it can only mean one thing can change.
Code:
Swap over both sides in their entirety. Change LTA to RTA and vice versa and LTB to RTB and vice versa.
Change from what you have above to;
Left Trigger A = D3
Left Trigger B = D4
Right Trigger A = D2
Right Trigger B = D1
Ex: my L298N code consists of moving left by the right side moving forward and left side moving back, but i can also use q and e (u could use a and d) to turn by lowering the PWM on one side to turn, but if the PWM is at 0 then it prints "you must be driving for use". So an if statements sees if it is at 100 PWM or 0 PWM which tells if it is moving or not.
CustomMovementPanelforL298N.EZB
The file is also now on the cloud so I hope it can help you. The ports are different from yours but you could easily change your wiring or change the ports on the program.
Code: