Hello i wrote the code it has no errors and it succesffully deployed to robot i looked at driver station
and everything looks ok but the robot doesnt moves can you pls help me ?
The code:
// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
Some of what you have in that code should really be in constants instead, but can you also just post your github repo so we can see your drive subsystem?
Print the values of left and right to assure that you are telling the motors to operate.
Have you set the correct motor type - brushless/brushed?
Verify that your PWM wiring to the motor controllers is correct. (You haven’t confused CAN with PWM, have you? CAN has different wiring and different Java code.)
Post the complete rioLOG for the deploy through failure to perform correctly.
Are you sure you’re using the right joystick axes? On an xbox controller you’d want to use 0 and 4 for your throttle and turn. To make sure, go to driverstation and click the USB icon on the left-hand side of the window. That will tell you if a) you are actually getting a joystick reading, and b) what port it’s running on. If you click on the joystick in the driverstation window, it’ll also give you a rundown of the buttons and axes on the controller
Other posts here helped make sure the joystick values are correctly used. Add a print statement to these statements to verify successfully accessing the joysticks.
double left = speed + turn;
double right = speed - turn;
System.out.println("left " + left + ", right " + right);
Is there a specific reason you are using PWMs instead of CAN for these Spark Max’s ?
Nobody here has asked so I figured I would. Do you know the difference or did you find some example code and follow that ? If your really using CAN did you set the IDs properly ?