Go to Post Think about the other teams...today your opponent, today your teammate. - Al Skierkiewicz [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 26-10-2014, 12:57
speckz speckz is offline
Registered User
FTC #8910
 
Join Date: Oct 2014
Location: United States
Posts: 2
speckz is an unknown quantity at this point
Logitech USB Controller Programming Issues

We cannot get our Logitech USB controllers to work properly with our code in RobotC. The debugger picks up when buttons are pressed and joysticks are moved correctly but when the code is run the code will not pick up what is going on with the controller.

Here is the code:

Code:
#pragma config(Hubs,  S1, MatrxRbtcs, none,     none,     none)
#pragma config(Sensor, S1,     ,               sensorI2CMuxController)
#pragma config(Motor,  mtr_Matrix_S1_1, motorD,        tmotorTetrix, openLoop)
#pragma config(Motor,  mtr_Matrix_S1_2, motorE,        tmotorTetrix, openLoop)
#pragma config(Motor,  mtr_Matrix_S1_3, motorF,        tmotorMatrix, openLoop)
#pragma config(Motor,  mtr_Matrix_S1_4, motorG,        tmotorMatrix, openLoop)
#pragma config(Servo,  srvo_Matrix_S1_1, servo1,               tServoNone)
#pragma config(Servo,  srvo_Matrix_S1_2, servo2,               tServoNone)
#pragma config(Servo,  srvo_Matrix_S1_3, servo3,               tServoNone)
#pragma config(Servo,  srvo_Matrix_S1_4, servo4,               tServoNone)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

#include "JoystickDriver.c"

task main()
{
  servo[servo1] = -127;
  wait1Msec(500);

  while (true)
  {
  	getJoystickSettings(joystick);
  	if(joy1Btn(00) == true)
  		servo[servo1] = 127
  }
}
This is a matrix robot for the First Tech Challenge. Moving motors and servos normally works fine but when we try to do it with a USB controller the code does not pick anything up.
We are using NXT brick which has the correct firmware from RobotC 4.26.

What might we be doing wrong? Thank you.
  #2   Spotlight this post!  
Unread 26-10-2014, 17:09
ehochstein's Avatar
ehochstein ehochstein is offline
Coach, Volunteer & Mentor
AKA: Evan Hochstein
FTC #5943 (ESGM)
Team Role: Coach
 
Join Date: Jan 2009
Rookie Year: 2007
Location: Bloomington, Minnesota
Posts: 933
ehochstein has a brilliant futureehochstein has a brilliant futureehochstein has a brilliant futureehochstein has a brilliant futureehochstein has a brilliant futureehochstein has a brilliant futureehochstein has a brilliant futureehochstein has a brilliant futureehochstein has a brilliant futureehochstein has a brilliant futureehochstein has a brilliant future
Re: Logitech USB Controller Programming Issues

Code:
#pragma config(Hubs,  S1, MatrxRbtcs, none,     none,     none)
#pragma config(Sensor, S1,     ,               sensorI2CMuxController)
#pragma config(Motor,  mtr_Matrix_S1_1, motorD,        tmotorTetrix, openLoop)
#pragma config(Motor,  mtr_Matrix_S1_2, motorE,        tmotorTetrix, openLoop)
#pragma config(Motor,  mtr_Matrix_S1_3, motorF,        tmotorMatrix, openLoop)
#pragma config(Motor,  mtr_Matrix_S1_4, motorG,        tmotorMatrix, openLoop)
#pragma config(Servo,  srvo_Matrix_S1_1, servo1,               tServoNone)
#pragma config(Servo,  srvo_Matrix_S1_2, servo2,               tServoNone)
#pragma config(Servo,  srvo_Matrix_S1_3, servo3,               tServoNone)
#pragma config(Servo,  srvo_Matrix_S1_4, servo4,               tServoNone)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

#include "JoystickDriver.c"

task main()
{
  servo[servo1] = -127;
  wait1Msec(500);

  while (true)
  {
  	getJoystickSettings(joystick);
  	if(joy1Btn(00) == true)
  		servo[servo1] = 127;
  }
}
Try this and see if you can figure out what I changed.
__________________
Minnesota FIRST Senior Mentor | 2013-?

Stratasys Applications Engineering Technician | 2016-?

2009 Regional Win – 2470 @ 10k Lakes (Thanks 2826 and 1714)
2013 WFFA Recipient – 2470 @ 10K Lakes
2016 Ri3D: 'Snow Problem Reveal
2017 Ri3D: 'Snow Problem Reveal

The opinions expressed above are the personal opinions of the author and do not necessarily represent the views and opinions of any organization the author is affiliated with.
  #3   Spotlight this post!  
Unread 29-10-2014, 15:44
speckz speckz is offline
Registered User
FTC #8910
 
Join Date: Oct 2014
Location: United States
Posts: 2
speckz is an unknown quantity at this point
Re: Logitech USB Controller Programming Issues

Quote:
Originally Posted by Wiifi View Post
Code:
#pragma config(Hubs,  S1, MatrxRbtcs, none,     none,     none)
#pragma config(Sensor, S1,     ,               sensorI2CMuxController)
#pragma config(Motor,  mtr_Matrix_S1_1, motorD,        tmotorTetrix, openLoop)
#pragma config(Motor,  mtr_Matrix_S1_2, motorE,        tmotorTetrix, openLoop)
#pragma config(Motor,  mtr_Matrix_S1_3, motorF,        tmotorMatrix, openLoop)
#pragma config(Motor,  mtr_Matrix_S1_4, motorG,        tmotorMatrix, openLoop)
#pragma config(Servo,  srvo_Matrix_S1_1, servo1,               tServoNone)
#pragma config(Servo,  srvo_Matrix_S1_2, servo2,               tServoNone)
#pragma config(Servo,  srvo_Matrix_S1_3, servo3,               tServoNone)
#pragma config(Servo,  srvo_Matrix_S1_4, servo4,               tServoNone)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

#include "JoystickDriver.c"

task main()
{
  servo[servo1] = -127;
  wait1Msec(500);

  while (true)
  {
  	getJoystickSettings(joystick);
  	if(joy1Btn(00) == true)
  		servo[servo1] = 127;
  }
}
Try this and see if you can figure out what I changed.

Yes I realize I missed a semicolon but that's not the problem it still doesn't work. I know my code is right I'm positive it's something with the setup but find nothing wrong with the setup.
Closed Thread


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 02:38.

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