![]() |
Any help appreciated
I have written a simple java program to test our 2016 bot. I have update the firmware, image and jre on our 2015 roborio, and updated to the latest version of Eclipse. Our drive consists of four motors – one Talon controller with a y-splitter controls the two left motors, and another Talon with a y-splitter controls the two right motors.
The bot works with a simple arcade drive coded in the teleop method. When I add the setInvertedMotors code (which worked last year), I get “no code” on the bot, a red comm light on the roborio, and the following error: ERROR Unhandled exception: java.lang.NullPointerException at [edu.wpi.first.wpilibj.RobotDrive.setInvertedMotor( RobotDrive.java:703), org.usfirst.frc.team4951.robot.Robot.robotInit(Rob ot.java:38), edu.wpi.first.wpilibj.IterativeRobot.startCompetit ion(IterativeRobot.java:72), edu.wpi.first.wpilibj.RobotBase.main(RobotBase.jav a:241)] Here is my code: Code:
import edu.wpi.first.wpilibj.IterativeRobot; |
Re: Any help appreciated
I don't know Java, but my guess is skip using robotdrive.motortype. That class presumes 4 control signals, whereas you only have 2.
Use robotdrive(left channel, right channel) to set your motor channels. Also, I presume you are using one motor controller per motor, and splitting the Pwm signal. You can't drive 2 cim motors with one controller. |
Re: Any help appreciated
Quote:
|
Re: Any help appreciated
Rich/Joe, thanks for the helpful advice.
I will do what Joe has suggested. Thanks again. |
| All times are GMT -5. The time now is 00:38. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi