View unanswered posts | View active topics It is currently Fri Oct 31, 2014 5:10 am






Reply to topic  [ 8 posts ] 
Please need help, no buttons work 
Author Message
Rookie

Joined: Wed Jan 29, 2014 8:56 pm
Posts: 4
Post Please need help, no buttons work
#include "JoystickDriver.c"

task main()
{
while(1 == 1)
{
getJoystickSettings(joystick);

motor[motorWright] = joystick.joy1_y1; // Motor D is assigned a power level equal to the right analog stick's Y-axis reading.
motor[motorWleft] = joystick.joy1_y2; // Motor E is assigned a power level equal to the left analog stick's Y-axis reading.


if(joy1Btn(4) == 1)
{
motor(motorAright) = -100;
}
else if (joy1Btn(7) == 1)
{
motor(motorAright)= 100;
}
else
{
motor(motorAright)= 0;
}

if(joy1Btn(4) == 1)
{
motor(motorAleft) = -100;
}
else if (joy1Btn(7) == 1)
{
motor(motorAleft)= 100;
}
else
{
motor(motorAleft)= 0;
}


if(joy1Btn(1) == 1)
{
servo(servo1) = 256;
}
else if (joy1Btn(2) == 1)
{
servo(servo1)= 0;
}
else
{
servo(servo1)= 127;
}

}








}

This is my code, for some reason none of the joysticks, nor joystick buttons work. They used to but now it does not for some reason. I was hoping someone here can help me. Please and thank you.


Wed Jan 29, 2014 9:14 pm
Profile
Rookie

Joined: Wed Jan 29, 2014 8:56 pm
Posts: 4
Post Re: Please need help, no buttons work
Anybody ? :(


Thu Jan 30, 2014 12:44 am
Profile
Guru
User avatar

Joined: Sun Nov 15, 2009 5:46 am
Posts: 1347
Post Re: Please need help, no buttons work
Have you opened the joystick dialog? If so, do the buttons on the picture respond to your pressing of them?


Thu Jan 30, 2014 4:28 am
Profile
Rookie

Joined: Wed Jan 29, 2014 8:56 pm
Posts: 4
Post Re: Please need help, no buttons work
Yes I have and every button works


Thu Jan 30, 2014 4:35 am
Profile
Guru
User avatar

Joined: Sun Nov 15, 2009 5:46 am
Posts: 1347
Post Re: Please need help, no buttons work
Code:
#include "JoystickDriver.c"

task main()
{
    while(1 == 1)
    {
        getJoystickSettings(joystick);

        motor[motorWright] = joystick.joy1_y1;         // Motor D is assigned a power level equal to the right analog stick's Y-axis reading.
        motor[motorWleft] = joystick.joy1_y2;         // Motor E is assigned a power level equal to the left analog stick's Y-axis reading.

        if(joy1Btn(4) == 1)
        {
            nxtDisplayTextLine(1, "Btn4");
            motor(motorAright) = -100;
            motor(motorAleft) = -100;
        }
        else if (joy1Btn(7) == 1)
        {
            nxtDisplayTextLine(1, "Btn7");
            motor(motorAright)= 100;
            motor(motorAleft) = 100;
        }
        else
        {
            nxtDisplayTextLine(1, "");
            motor(motorAright)= 0;
            motor(motorAleft) = 0;
        }

        if(joy1Btn(1) == 1)
        {
            nxtDisplayTextLine(2, "Btn1");
            servo(servo1) = 256;
        }
        else if (joy1Btn(2) == 1)
        {
            nxtDisplayTextLine(2, "Btn2");
            servo(servo1)= 0;
        }
        else
        {
            nxtDisplayTextLine(2, "");
            servo(servo1)= 127;
        }

        wait1Msec(100);
    }
}

How about this code? What does the LCD display say?


Thu Jan 30, 2014 4:47 am
Profile
Rookie

Joined: Wed Jan 29, 2014 8:56 pm
Posts: 4
Post Re: Please need help, no buttons work
it says
Ext Batt: 3.0 V
nxt batt: 7.5 V
FMS mssgs: 0
teleop filename:

also its blinking wait for start and its blinking even tho i already pressed start


Thu Jan 30, 2014 4:08 pm
Profile
Expert
User avatar

Joined: Sat Aug 31, 2013 9:15 am
Posts: 158
Post Re: Please need help, no buttons work
Saints768 wrote:
it says
Ext Batt: 3.0 V
nxt batt: 7.5 V
FMS mssgs: 0
teleop filename:

also its blinking wait for start and its blinking even tho i already pressed start


Ah, sounds like you need to use the "Joystick Control - Competition" debug window. Use that one for joystick control, and make sure you select the "Teleop - Running" radio button. (You'll have to select "Teleop - Ready" first.)

_________________
FTC Team 6100 Chariots of Fire - Programmer (2012-2013)
FTC Team 7468 Blue Chariots of Fire - Programmer (2013-2014)
FTC Team 7468 Blue Chariots of Fire - Mentor (2014-2015)
Check out our team website at http://cof7468.weebly.com/.


Thu Jan 30, 2014 7:59 pm
Profile
Guru
User avatar

Joined: Sun Nov 15, 2009 5:46 am
Posts: 1347
Post Re: Please need help, no buttons work
Saints768 wrote:
it says
Ext Batt: 3.0 V
nxt batt: 7.5 V
FMS mssgs: 0
teleop filename:

also its blinking wait for start and its blinking even tho i already pressed start

Ah, sounds like you need a new battery. Ext Batt is about 12V. 3.0V is extremely low.


Thu Jan 30, 2014 9:55 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 8 posts ] 

Who is online

Users browsing this forum: mightor 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:  



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