View Single Post
  #1   Spotlight this post!  
Unread 07-02-2013, 02:09
Martian86 Martian86 is offline
Registered User
FRC #1159
Team Role: Alumni
 
Join Date: Sep 2012
Rookie Year: 2011
Location: California
Posts: 28
Martian86 is just really niceMartian86 is just really niceMartian86 is just really niceMartian86 is just really niceMartian86 is just really nice
Problem programming buttons

We need buttons 1-4 on our game controller to set two different motors to the same speed when each button is pressed; each button is a different speed setting. Only one of them works properly for some reason (more on that in a minute), but the other three are identical as far as I can tell other than the button number and speed assignment.

The one that works:
Button 1--> Case structure: two true constants of -.67 and two false constants of 0-->WPIMotorControlSetOutput.vi (a separate one for each constant) --> WPIMotorControlRefNum Registry Get.vi (a separate one for each set output) -->motor names (since I lack creativity their names are "motor 1" and "motor 2")

The ones that don't work are exactly the same except the button numbers are different and the true constants in the case structure are different.

As I said, the button 1 programming works: it runs the motor at 2/3 speed. Buttons 2, 3, and 4 either don't work at all or make the motor twitch a little. Some of the things we've tried and what happened:
-Use different game controller: no difference
-Use different motor: no difference
-Use different PWMs: no difference
-Change speed in the button 1 code: button 1 sets motor to whatever speed we specified
-Disable code for buttons 3 and 4: button 1 still works and button 2 does not

At this point I'm not sure what I did, but I think I messed something up or accidentally deleted something, so I'm not too sure how credible this next piece of troubleshooting was; thankfully I had my pre-troubleshooting code saved elsewhere; I'll try it again tomorrow with that. Anyway, my next step:

-With buttons 3 and 4 still disabled, I changed the button assignment for the piece of code that we know works from button 1 to button 3. After this, none of the buttons worked.

Any ideas on what could be wrong? Thanks in advance for your input.

Last edited by Martian86 : 07-02-2013 at 02:15.
Reply With Quote