Team2168 / 2014_Main_Robot

Code for the 2014 FRC season.
Other
2 stars 1 forks source link

MomentarySolenoid Constructor #27

Closed NotInControl closed 10 years ago

NotInControl commented 10 years ago

I don't believe this code does what you expect.

https://github.com/Team2168/FRC2014_Main_Robot/blob/master/src/org/team2168/utils/MomentaryDoubleSolenoid.java#L46

The 1000 is seen as an int, so instead of calling the constructor which is (int, int, long) on line 31, it will call the constructor (int, int, int) which you also have defined on line 74.

When the constructor is called on L74, This will make moduleNumber = forward channel, forwardchannel = reverseChannel, and reverseChannel 1000, and so everytime the two parameter constructor is called, you are essentially allocated channel 1000 on module forwardChannel, which I think will crash at runtime

Need to type cast 1000 to long for it to work as intended.