View unanswered posts | View active topics It is currently Thu Jul 24, 2014 8:20 am






Reply to topic  [ 2 posts ] 
TeleOp: Remote control buttons are pushing my buttons :/ 
Author Message
Rookie

Joined: Mon Dec 02, 2013 9:37 am
Posts: 2
Post TeleOp: Remote control buttons are pushing my buttons :/
We are having problems with our TeleOp program where not a single button on any controller are seen as pressed by the program. The controllers are set to DirectInput mode, not XInput. We have tried through RobotC and through Samantha Field Control, but neither work. The controllers and how we have set things up both through RobotC and through field control are correct because the use of joysticks functions properly.

We have determined that this is some kind of problem in the program or in the drivers. The joystick debug window in RobotC (competition AND normal) both display the use of buttons and the correct buttons being pushed, but the program does not work. Utilizing the local variables debug window, we found that no matter what button is pushed it always returns 0 as the value. We even found through the same method that joystick.joy1_Buttons is also constantly 0.

We have tried many things. We tried using joy1Btn(int) as a boolean value, as well as an integer value.

We also made this program specifically for testing these buttons where it just displays something on the screen.

Button Tester: https://gist.github.com/robotics5040/678d2c9c74af86f91aab%20
TeleOp: https://gist.github.com/robotics5040/cd736788010c41d34ec6

Thanks for any help you can provide!


Tue Dec 03, 2013 9:13 am
Profile
Guru
User avatar

Joined: Sun Nov 15, 2009 5:46 am
Posts: 1347
Post Re: TeleOp: Remote control buttons are pushing my buttons :/
Were you able to drive the robot with the joysticks? If you can, the buttons should work. In other words, does the following code work?
Code:
#include "JoystickDriver.c"
#define DEADBAND(n, d)    ((abs(n) >= (d))? (n): 0)
task main()
{
    StopTask(displayDiagnostics);
    eraseDisplay();
    while (true)
    {
        getJoystickSettings(joystick);
        motor[motorH] = motor[motorI] = DEADBAND(joystick.joy1_y1);
        motor[motorG] = motor[motorF] = DEADBAND(joystick.joy1_y2);
        nxtDisplayTextLine(1, "Joy1Btns=%x", joystick.joy1_Buttons);
        nxtDisplayTextLine(2, "Joy2Btns=%x", joystick.joy2_Buttons);
        wait1Msec(100);
    }
}


Tue Dec 03, 2013 4:53 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.