ROBOTC.net forums
http://robotc.net/forums/

Internal Parameter
http://robotc.net/forums/viewtopic.php?f=52&t=7641
Page 1 of 1

Author:  RobotDaddy [ Wed Jan 08, 2014 6:48 pm ]
Post subject:  Internal Parameter

We are using joysticks to run a code and it was working before, but now it says "Error: Internal Parameters". I don't know what that means or how to fix it. Can anyone help?

Author:  BurningLights [ Thu Jan 09, 2014 11:08 am ]
Post subject:  Re: Internal Parameter

Could you please post your code so we can take a look at it? Also, when do you get the error? Is it while compiling, or while the program is running on the NXT?

Author:  RobotDaddy [ Thu Jan 09, 2014 12:06 pm ]
Post subject:  Re: Internal Parameter

BurningLights wrote:
Could you please post your code so we can take a look at it? Also, when do you get the error? Is it while compiling, or while the program is running on the NXT?

It shows on on the right controller when I click debugger windows>Joystick Competition.

Code:
#pragma config(Hubs,  S1, HTMotor,  none,     none,     none)
#pragma config(Hubs,  S2, HTMotor,  none,     none,     none)
#pragma config(Hubs,  S3, HTMotor,  none,     none,     none)
#pragma config(Sensor, S1,     ,               sensorI2CMuxController)
#pragma config(Sensor, S2,     ,               sensorI2CMuxController)
#pragma config(Sensor, S3,     ,               sensorI2CMuxController)
#pragma config(Motor,  mtr_S1_C1_1,     motorF,        tmotorTetrix, openLoop, reversed)
#pragma config(Motor,  mtr_S1_C1_2,     motorG,        tmotorTetrix, openLoop)
#pragma config(Motor,  mtr_S2_C1_1,     motorD,        tmotorTetrix, openLoop)
#pragma config(Motor,  mtr_S2_C1_2,     motorE,        tmotorTetrix, openLoop, reversed)
#pragma config(Motor,  mtr_S3_C1_1,     motorH,        tmotorTetrix, openLoop)
#pragma config(Motor,  mtr_S3_C1_2,     motorI,        tmotorTetrix, openLoop, reversed)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

#include "JoystickDriver.c"

task main()
{

while(true)
    {
        getJoystickSettings(joystick);
        motor[motorD] = joystick.joy1_y1;
        motor[motorE] = joystick.joy1_y2; //Motor E is Reversed

        getJoystickSettings(joystick);
         {if(abs(joystick.joy2_y1) > 10){
         {
        motor[motorF] = joystick.joy2_y1/2;
        motor[motorG] = joystick.joy2_y1/2; //Motor G is reversed
        else{
           motor[motorF] = 0;
           motor[motorG] = 0;
      }}}
            { if(abs(joystick.joy2_y2) > 10){
        motor[motorH] = joystick.joy2_y2/2;
        motor[motorI] = joystick.joy2_y2/2; //Motor I is reversed
        else{
           motor[motorH] = 0;
           motor[motorI] = 0;
        }}}

    }


Author:  cookthebook [ Thu Jan 09, 2014 1:08 pm ]
Post subject:  Re: Internal Parameter

I believe the problem might be that your else statements are inside your if statements:
Code:
         {if(abs(joystick.joy2_y1) > 10){
         {
        motor[motorF] = joystick.joy2_y1/2;
        motor[motorG] = joystick.joy2_y1/2; //Motor G is reversed
        else{
           motor[motorF] = 0;
           motor[motorG] = 0;
      }}}


This can be shortened to:
Code:
         if(abs(joystick.joy2_y1) > 10){
        motor[motorF] = joystick.joy2_y1/2;
        motor[motorG] = joystick.joy2_y1/2; //Motor G is reversed
        }
        else{
           motor[motorF] = 0;
           motor[motorG] = 0;
        }


I tried compiling this exact code in RobotC 3.62 and it threw me a major error on the else statements and merely ignored them, I have no idea how your code is even compiling for you. So I would fix those problems and then see how it works.

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/