View Single Post
  #4   Spotlight this post!  
Unread 18-03-2013, 18:45
Arhowk's Avatar
Arhowk Arhowk is offline
FiM CSA
AKA: Jake Niman
FRC #1684 (The Chimeras) (5460 Mentor)
 
Join Date: Jan 2013
Rookie Year: 2013
Location: Lapeer
Posts: 543
Arhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to behold
Re: Reassigning button.whenPressed during teleop

Quote:
Originally Posted by shindigo View Post
Wow -that is some pretty snappy code! I have never seen the override of a get in a new before, but I'm a relative novice at java. Can any public method be overridden for an instance of a class in Java? I will give it a try tomorrow night.

Btw, do you have a link to the source of the wpilib? There are times when I would like to understand more about what is going on behind the scenes.

Thanks -

Mike Parker - programming mentor, team 102
https://github.com/1684chimeras/2013...cedButton.java

lil something i made, allows you to assign different commands to different modes than set the mode of the button (e.g. set A to lock for drive, B for climb in climbing than set the mode of all the buttons to 2 when u want to climb)

Button source code is in C:\Users\yourname\sunspotfrcsdk\lib\wpilibj.src.zi p

to your override question.... Yeah you can override any public method. You can also use super.(method) to refer to the method that you were overriding
Reply With Quote