|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Re: Defining/Setting a motor in Java
I have always written it in one line directly under the class statement not in robotinit.
Talon motor = new Talon(0); Your problem may be from splitting it up. |
|
#2
|
|||
|
|||
|
Re: Defining/Setting a motor in Java
That shouldn't cause it, his motor reference would just be null prior to calling robotInit().
|
|
#3
|
||||
|
||||
|
Re: Defining/Setting a motor in Java
The error stack shows Robot.java:31, meaning line 31. You don't have 31 lines posted in your thread.
And you're missing a curly brace to close the class. The above by itself wouldn't compile. |
|
#4
|
|||
|
|||
|
Re: Defining/Setting a motor in Java
That's because I had a bunch of blank space and comments that I got rid of when I copied and pasted the code here
I'm no longer getting errors in the console after moving to teleopPeriodic. But the motors still won't move. I checked the motors earlier by hooking them up to our battery. They work fine... |
|
#5
|
||||
|
||||
|
Re: Defining/Setting a motor in Java
I am having the same issue. I am trying to execute EXTREMELY basic code (operating a Victor). Yet, whenever I try to execute the code, nothing happens and my console gives no hints. Even the sample code does nothing to the robot right now. It successfully deploys yet does nothing.
|
|
#6
|
|||
|
|||
|
Re: Defining/Setting a motor in Java
Nevermind. It was a stupid electrical error. I thought I had checked the system thoroughly but apparently I hadn't.
Thanks for letting me know it wasn't the code's fault. |
|
#7
|
||||
|
||||
|
Re: Defining/Setting a motor in Java
Quote:
![]() |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|