A couple of simple issues.
- The code for joystick control is in the Default_Routine() a few lines below the Process_Data_From_Master_uP routine(). The 1-Joystick code starts there on line 226 (in the version I attached). (In MPLAB look under Edit -> Properties and check "line numbers" if you don't already see them.)
- There was a ". . ." in my example above that isn't code and needs to be removed (sorry about that).
- Set both the MOTOR_CORRECTION's to zero to begin with. You'll only need to adjust those values if the operator cannot manually correct for the robot pulling to one side or the other. I don't know how hard it will be for your operator to see the robot underwater.
- Make sure your drive motor pwms are connected to pwm 13 (right motor) and pwm 15 (left motor).
I've attached a modified version, so you can see what I meant.
the new code is at lines 204-205 and 239-255.
What you wrote originally will actually work, but would be confusing to anyone reading the code, because it does all the joystick work in Default_Routine() then overrides it all in Process_Data_From_Master_uP().
Anyone else have comments to add?