View unanswered posts | View active topics It is currently Fri Nov 28, 2014 5:09 am






Reply to topic  [ 2 posts ] 
ROBOTC Exeption Violation Report 
Author Message
Rookie

Joined: Fri Jan 23, 2009 9:45 pm
Posts: 1
Post ROBOTC Exeption Violation Report
Someone help me please I have no idea what caused this to happen.

Byte Code Interpreter Exception:

Program Slot: 0. Task ID: main[0]
Error at PC: Task offset 00D1
Task PC: Task offset start (0).
TaskState: 'Exception'
Exception Type: 'Motor out of range(2)'

Code:
      if(abs(joystick.joy1_y1) <= 10)
      {
        motor[motorE] = 0;
      }
      else
      {
        motor[motorE] = joystick.joy1_y1;  //Assign motorD (Motor 1) to the Left Y-Axis
      }
      if(abs(joystick.joy1_y2) <= 10)
      {
        motor[motorD] = 0;
      }
      else
      {
        motor[motorD] = joystick.joy1_y2;  //Assign motorE (Motor 2) to the Right Y-Axis
      }
      if(joy1Btn(01) != 0)
      {
        servo[Servo1] = 22.5;
        servo[Servo2] = 255;
      }
      else
      {
        servo[Servo1] = 150;
        servo[Servo2] = 127.5;
      }
      if(abs(joystick.joy2_y1) <= 10)
      {
        motor[motorF] = 0;
      }
      else
      {
        motor[motorF] = 65*joystick.joy2_y1;  //Assign MotorF (Motor 3) to the Left Y-Axis of controler 2
      }
      if(abs(joystick.joy2_y2) <= 10)
      {
        motor[motorG] = 0;
      }
      else
      {
        motor[motorG] = 65*joystick.joy2_y2;  //Assign MotorG (Motot 4) to the Right Y-Axis of controler 2
      }


:cry: Saddened because it worked yesterday then I moved it into the new template and FAIL.


Fri Jan 23, 2009 9:58 pm
Profile
Expert
User avatar

Joined: Mon Oct 06, 2008 6:30 pm
Posts: 176
Location: Netherlands
Post Re: ROBOTC Exeption Violation Report
The problem is that your motors accept values up to 100 while the joystick sends values up to 127. This is too much.
This problem only shows up when you give the joystick a full forward. Take and look in the topic: my nxt keep freezing for the solution.

_________________
My most recent blog: A grain of sugar


Sat Jan 24, 2009 10:53 am
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users 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.