So I am a beginner to Java programming and can’t get it to work
Anyone have an idea as to why?
Do you use github? I’m sorry but I can’t read this picture. Linking it on github would be very appreciated.
Only thing I can see from the picture is line 128 (sick vs stick), but beyond that, please share your full code (ideally via github or similar service)
I use WPILib
GitHub is a website for hosting Git Source Code Repositories, not a programming library. It would help us help you if we could look at your entire codebase, and the easiest way for us to do that is for you to create a repository on GitHub, push your code to it, and link it here so we can browse your entire code.
Will do that
Seeing as how the .set is red underlined, I would assume that the rightArm and leftArm objects may not be setup properly. because of the (1.0), i would think they are motor objects, so until you can get the rest onto github, maybe check if the arms are created properly.
All the sets and setpower’s are red besides the pneumatics.
I don’t think the link worked
yeah it didnt, try this one. https://github.com/damiendash191/frc/blob/main/Frc%20program .
Works
Have does vscode say when u hover over the red underlines?
Also have you tried fixing the leftArm set command where is says sick instead of stick.
You are using the CAN TalonSRX Class from the CTRE Phoenix Library. According to the JavaDoc the set()
method for the TalonSRX
takes in two parameters, first is a TalonSRXControlMode
and the second is a double
. So you need to pass both parameters.
https://store.ctr-electronics.com/content/api/java/html/classcom_1_1ctre_1_1phoenix_1_1motorcontrol_1_1can_1_1_talon_s_r_x.html#aa8a9315c026864fb9754bd3379a38871
Okay looks like instead of 1, you would need something like rightArm.set(TalonSRXControlMode PercentOutput, 1.0);
Ohhhhhhhh!!! Let me try that
It works. Thank you so much guys. Good luck on the competition!!!
Glad that worked out, ty and gl yourself.
Another question. What is the port number for TalonSRX?