Go to Post Remember that the reason that you do something should NEVER be for the sole purpose of winning an award. To paraphrase something said by one of the Hall of Fame teams: "You should choose to do something because it is fun and the right thing to do." - tim-tim [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

 
View Poll Results: What programming software does your FTC team use?
RobotC 10 83.33%
LabVIEW 2 16.67%
Voters: 12. You may not vote on this poll

 
 
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 10-04-2010, 21:59
MattSr's Avatar
MattSr MattSr is offline
Mentor/Programmer/Animator
AKA: Matt Cyril Senior
FRC #0488 (Team Xbot)
Team Role: Programmer
 
Join Date: Jan 2008
Rookie Year: 2006
Location: Seattle, Washington
Posts: 21
MattSr is an unknown quantity at this point
Send a message via AIM to MattSr Send a message via MSN to MattSr Send a message via Yahoo to MattSr
Angry [FTC]: RobotC Issue

So i learned RobotC pretty much in about 2 hours, at first everything was going decently but after a while, this message started popping up on my NXT followed by two beeps as well as not letting my code run:

Code:
PgmCnt: 000129
Type: 2
Here is my code

Code:
//Motor and Servo Hubs
#pragma config(Hubs, S1, HTMotor, HTMotor, HTMotor, none)
#pragma config(Hubs, S2, HTServo, none, none, none)
//Tetrix Motors
#pragma config(Motor, mtr_S1_C1_1, rightdrive, tmotorNormal, openLoop)
#pragma config(Motor, mtr_S1_C1_2, leftdrive, tmotorNormal, openLoop)
#pragma config(Motor, mtr_S1_C2_1, shooter1, tmotorNormal, openLoop)
#pragma config(Motor, mtr_S1_C2_2, helix, tmotorNormal, openLoop, reversed)
#pragma config(Motor, mtr_S1_C3_1, shooter2, tmotorNormal, openLoop)
#pragma config(Motor, mtr_S1_C3_2, roller, tmotorNormal, openLoop)
//Servos
#pragma config(Servo, srvo_S2_C1_1, blocker, tServoNormal)
#pragma config(Servo, srvo_S2_C1_2, ramp, tServoNormal)
#pragma config(Servo, srvo_S2_C1_3, leftarm, tServoNormal)
#pragma config(Servo, srvo_S2_C1_4, rightarm, tServoNormal)
//Lego Motors
#pragma config(Motor, motorA, , tmotorNormal, PIDControl)
#pragma config(Motor, motorB, , tmotorNormal, PIDControl)
#pragma config(Motor, motorC, , tmotorNormal, PIDControl)

#include "JoystickDriver.c"  //Include file to "handle" the Bluetooth messages.

void initializeRobot() //Initialize Servo Positions
{
  servo[blocker]=120;
  servo[ramp]=0;
  servo[leftarm]=255;
  servo[rightarm]=255;
  return;
}

task main()
{
  initializeRobot();

  waitForStart(); //Wait for start of tele-op phase
  //Set Global Variables
  int shooterpower=0;
  int rhlpower=0;
  bool ldzero=false;
  bool rdzero=false;
  bool rhlzero=false;
  while (true)
  {
    getJoystickSettings(joystick); //Update variables with current joystick values

    //Controller 1
    //Leftjoy = left motors
    //Rightjoy = right motors
    //Btn 8 = Roller 100, Helix 100, Lego 100

    //Controller 2
    //Btn2 = Shooter 80
    //Btn3 = Shooter 90
    //Btn4 = Shooter 100
    //Btn5 = Servo left arm to 0 (left arm starts at 255)
    //Btn6 = Servo right arm to 0 (right arm starts at 255)
    //Btn7 = Servo Ramp to 180 (Ramp starts at 0)
    //Btn8 = Servo Blocker to 160 (Blocker starts at 120)
    
    if((joystick.joy1_y1)>5) //Left Drive
    {
      motor[leftdrive]=joystick.joy1_y1;
      ldzero=false;
    }
    else if((joystick.joy1_y1<=5&&ldzero==false))
    {
      motor[leftdrive]=0;
      ldzero=true;
    }
    
    if ((joystick.joy1_y2)>5) //Right Drive
    {
      motor[rightdrive]=joystick.joy1_y2;
      rdzero=false;
    }
    else if((joystick.joy1_y2<=5&&rdzero==false))
    {
      motor[leftdrive]=0;
      rdzero=true;
    }

    if(joy1Btn(8)) //Roller, Helix, and Lego
    {
      rhlpower=100;
      motor[roller]=rhlpower;
      motor[helix]=rhlpower;
      motor[motorA]=rhlpower;
      motor[motorB]=rhlpower;
      motor[motorC]=rhlpower;
      rhlzero=false;
    }
    else if((joy1Btn(8))==false&&rhlzero==false)
    {
      rhlpower=0;
      motor[roller]=rhlpower;
      motor[helix]=rhlpower;
      motor[motorA]=rhlpower;
      motor[motorB]=rhlpower;
      motor[motorC]=rhlpower;
      rhlzero=true;
    }

    if(joy1Btn(4)) //Shooter
    {
      shooterpower=100;
      motor[shooter1]=shooterpower;
      motor[shooter2]=shooterpower;
    }
    else if(joy2Btn(3))
    {
      shooterpower=90;
      motor[shooter1]=shooterpower;
      motor[shooter2]=shooterpower;
    }
    else if(joy2Btn(2))
    {
      shooterpower=80;
      motor[shooter1]=shooterpower;
      motor[shooter2]=shooterpower;
    }

    if(joy2Btn(5)) //LeftArm
    {
      servo[leftarm]=0;
    }
    else
    {
      servo[leftarm]=255;
    }

    if(joy2Btn(6)) //RightArm
    {
      servo[rightarm]=0;
    }
    else
    {
      servo[rightarm]=255;
    }

    if(joy2Btn(7)) //Ramp
    {
      servo[ramp]=180;
    }
    else
    {
      servo[ramp]=0;
    }

    if(joy2Btn(8)) //Blocker
    {
      servo[blocker]=180;
    }
    else
    {
      servo[blocker]=120;
    }
  }
}
I have been working on this one issue for about 3 hours now so here's thanks in advance to anyone willing to help

Update: April 10, 2010, 11:30pm GMT-7

The line
Code:
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
doesn't make any difference in the error

i have updated my code and from changing the servo config lines as suggested, i got a new message which i have updated above also.
__________________


Much love to my favorite FRC teams:
1983 Skunkworks - 360 The Revolution - 2898 Flying Hegehogs - 2557 Sota Bots - 2942 Tech Robotics

Last edited by MattSr : 11-04-2010 at 15:33. Reason: Small edits to code
Reply With Quote
 


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
[FTC]: RobotC Question Connor FIRST Tech Challenge 2 21-02-2010 10:52
[FTC]: Buttons RobotC JohnFogarty FIRST Tech Challenge 2 25-11-2009 19:13
[FTC]: [FTC]: RobotC Template Problem (causing an FMS issue) and Potential Servo Prob PackersFan FIRST Tech Challenge 11 26-01-2009 21:25
[FTC]: RobotC Template gdo FIRST Tech Challenge 14 10-11-2008 06:26


All times are GMT -5. The time now is 18: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