Go to Post your robot may have a bit of a "pimpwalk" - GMKlenklen [more]
Home
Go Back   Chief Delphi > Other > FIRST Tech Challenge
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 05-07-2014, 10:04
FTC7584's Avatar
FTC7584 FTC7584 is offline
addicted to FIRST
AKA: Andrew S
FTC #7584 (Bad News Bots)
Team Role: Scout
 
Join Date: Feb 2014
Rookie Year: 2011
Location: Wilmington DE
Posts: 22
FTC7584 will become famous soon enough
[FTC]: Joystick Issues

Hi. As our team starts to work on some side projects over the summer, I've run into an issue with the joystick controller. To test it, I created a simple debugging program, but I still can't figure out why the joystick fails to work.

No matter where the joystick is, RobotC (code) seems to think it's still at (0,0), however, when bringing up the joystick control debug window, I can clearly see that RobotC can see the joystick movement. I've tested this in several different programs so far. I just wanted to make sure that I wasn't making some sort of systematic error in the code, so here is an example of the issue.

Code:
#include "JoystickDriver.c"
task main()
{
 while(true)
  {
    getJoystickSettings(joystick);
    if (joystick.joy1_x1 != 0 | joystick.joy1_y1 != 0) 
    {
    	writeDebugStreamLine("Test successful.");
  	}
  }
}
If anyone could provide any insight, that'd be great.
Reply With Quote
  #2   Spotlight this post!  
Unread 05-07-2014, 18:28
Foster Foster is offline
Engineering Program Management
VRC #8081 (STEMRobotics)
Team Role: Mentor
 
Join Date: Jul 2007
Rookie Year: 2005
Location: Delaware
Posts: 1,392
Foster has a reputation beyond reputeFoster has a reputation beyond reputeFoster has a reputation beyond reputeFoster has a reputation beyond reputeFoster has a reputation beyond reputeFoster has a reputation beyond reputeFoster has a reputation beyond reputeFoster has a reputation beyond reputeFoster has a reputation beyond reputeFoster has a reputation beyond reputeFoster has a reputation beyond repute
Re: [FTC]: Joystick Issues

Try

if (joystick.joy1_x1 != 0 || joystick.joy1_y1 != 0)

You are doing a bitwise OR with | and you want to do a logical OR ||
__________________
Foster - VEX Delaware - 17 teams -- Chief Roboteer STEMRobotics.org
2010 - Mentor of the Year - VEX Clean Sweep World Championship
2006-2016, a decade of doing VEX, time really flies while having fun
Downingtown Area Robotics Web site and VEXMen Team Site come see what we can do for you.
Reply With Quote
  #3   Spotlight this post!  
Unread 05-07-2014, 22:28
FTC7584's Avatar
FTC7584 FTC7584 is offline
addicted to FIRST
AKA: Andrew S
FTC #7584 (Bad News Bots)
Team Role: Scout
 
Join Date: Feb 2014
Rookie Year: 2011
Location: Wilmington DE
Posts: 22
FTC7584 will become famous soon enough
Re: [FTC]: Joystick Issues

That solved it, thanks!
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 18:22.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi