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

teleop will no longer run
http://robotc.net/forums/viewtopic.php?f=52&t=5493
Page 1 of 1

Author:  cookthebook [ Wed Feb 13, 2013 5:40 pm ]
Post subject:  teleop will no longer run

I'm having this problem that did not show up at all before. My teleop program has worked for weeks but for some reason my brain beeps, wont run the program, and the screen displays "PgmCnt : 00002F , Type: 2. Does anyone know what this means? I can post my code if you want to see it. Also the same brain is running my autonomous perfectly fine.

Author:  JohnWatson [ Thu Feb 14, 2013 12:46 pm ]
Post subject:  Re: teleop will no longer run

Usually when you see that error code, the NXT has 'crashed'; would you be able to post your code using the [code] tags? That way we will be able to see what the potential problems could be. Please be sure to post all of the code, including the #pragma statements.

Author:  cookthebook [ Fri Feb 15, 2013 8:39 am ]
Post subject:  Re: teleop will no longer run

Code:
#pragma config(Sensor, S4,     IRseeker,       sensorNone)
#pragma config(Motor,  mtr_S1_C1_1,     East,          tmotorTetrix, openLoop)
#pragma config(Motor,  mtr_S1_C1_2,     West,          tmotorTetrix, openLoop)
#pragma config(Motor,  mtr_S1_C2_1,     North,         tmotorTetrix, openLoop)
#pragma config(Motor,  mtr_S1_C2_2,     South,         tmotorTetrix, openLoop)
#pragma config(Motor,  mtr_S1_C3_1,     Lift,          tmotorTetrix, openLoop)
#pragma config(Motor,  mtr_S1_C3_2,     None,          tmotorTetrix, openLoop)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

#include "JoystickDriver.c"


task main()
{
while(true)
   {
getJoystickSettings(joystick);


if(joystick.joy1_y1 > 40 || joystick.joy1_y1 < -40 )
{
   motor[West] = -joystick.joy1_y1/2;
}

if(joy1Btn(5) == 1 && (joystick.joy1_y1 > 40 || joystick.joy1_y1 < -40))
{
   motor[West] = -joystick.joy1_y1/8;
}


if(joystick.joy1_y1 < 40 && joystick.joy1_y1 > -40)
{
   motor[West] = 0;
}


if(joystick.joy1_y2 > 40 || joystick.joy1_y2 < -40)
{
   motor[East] = joystick.joy1_y2/2;
}

if(joy1Btn(5) == 1 && (joystick.joy1_y2 > 40 || joystick.joy1_y2 < -40))
{
   motor[East] = joystick.joy1_y2/8;
}


if(joystick.joy1_y2 < 40 && joystick.joy1_y2 > -40)
{
   motor[East] = 0;
}


if(joystick.joy1_x1 > 40 || joystick.joy1_x1 < -40)
{
   motor[North] = -joystick.joy1_x1/2;
}

if(joy1Btn(5) == 1 && (joystick.joy1_x1 > 40 || joystick.joy1_x1 < -40))
{
   motor[North] = -joystick.joy1_x1/8;
}


if(joystick.joy1_x1 < 40 && joystick.joy1_x1 > -40)
{
   motor[North] = 0;
}


if(joystick.joy1_x2 > 40 || joystick.joy1_x2 < -40)
{
   motor[South] = joystick.joy1_x2/2;
}

if(joy1Btn(5) == 1 && (joystick.joy1_x2 > 40 || joystick.joy1_x2 < -40))
{
   motor[South] = joystick.joy1_x2/8;
}


if(joystick.joy1_x2 < 40 && joystick.joy1_x2 > -40)
{
   motor[South] = 0;
}

///////////////////////////////////////////////////////////////



if (joystick.joy1_TopHat == 4)
{
   motor[Lift] = -10;
}
if (joystick.joy1_TopHat == -1)
{
   motor[Lift] = 0;
}
if(joystick.joy1_TopHat == 0)
{
   motor[Lift] = 50;
}
}
}
Here's my teleop, hopefully the problem is just with the code.

Author:  cookthebook [ Sat Feb 16, 2013 12:37 am ]
Post subject:  Re: teleop will no longer run

I think I might have solved the problem, I haven't tested it yet, but I went into the motor setup on the robot tab and none of the old settings had really been saved, something must have happened when I had to re-install RobotC.

Author:  Ernest3.14 [ Sat May 18, 2013 3:17 pm ]
Post subject:  Re: teleop will no longer run

RobotC stores its preferences in registry keys (... I don't know why), which is probably why they were erased. It would be nice to have an "export preferences" feature ;)

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