View unanswered posts | View active topics It is currently Wed Oct 01, 2014 8:19 pm






Reply to topic  [ 5 posts ] 
I lost my default firmware 
Author Message
Rookie

Joined: Thu Oct 14, 2010 10:13 am
Posts: 1
Post I lost my default firmware
When I first got my new Cortex controller it had some code on it which allowed me to run my robot using remote control. When I installed ROBOTC I lost the default programming code. How can I get it back?


Thu Oct 14, 2010 10:15 am
Profile
Site Admin
Site Admin

Joined: Tue May 15, 2007 9:02 am
Posts: 405
Post Re: I lost my default firmware
Great question Robotcoop! The ROBOTC firmware does replace the default firmware, allowing you to write programs and fully customize your code. If you'd like the functionality of the default firmware back, but still want to use ROBOTC, you can download this code to your robot:

Code:
#pragma config(Sensor, in1,    ana1,                sensorPotentiometer)
#pragma config(Sensor, in2,    ana2,                sensorPotentiometer)
#pragma config(Sensor, in3,    ana3,                sensorPotentiometer)
#pragma config(Sensor, in4,    ana4,                sensorPotentiometer)
#pragma config(Sensor, in5,    ana5,                sensorPotentiometer)
#pragma config(Sensor, in6,    ana6,                sensorPotentiometer)
#pragma config(Sensor, in7,    ana7,                sensorPotentiometer)
#pragma config(Sensor, in8,    ana8,                sensorPotentiometer)
#pragma config(Sensor, dgtl1,  jmp1,                sensorTouch)
#pragma config(Sensor, dgtl2,  jmp2,                sensorTouch)
#pragma config(Sensor, dgtl3,  jmp3,                sensorTouch)
#pragma config(Sensor, dgtl4,  jmp4,                sensorTouch)
#pragma config(Sensor, dgtl5,  jmp5,                sensorTouch)
#pragma config(Sensor, dgtl6,  jmp6,                sensorTouch)
#pragma config(Sensor, dgtl7,  jmp7,                sensorTouch)
#pragma config(Sensor, dgtl8,  jmp8,                sensorTouch)
#pragma config(Sensor, dgtl9,  jmp9,                sensorTouch)
#pragma config(Sensor, dgtl10, jmp10,               sensorTouch)
#pragma config(Sensor, dgtl11, jmp11,               sensorTouch)
#pragma config(Sensor, dgtl12, jmp12,               sensorTouch)
#pragma config(Motor,  port1,           LeftDrive1,    tmotorNormal, openLoop)
#pragma config(Motor,  port2,           LeftDrive2,    tmotorNormal, openLoop)
#pragma config(Motor,  port3,           LeftDrive3,    tmotorNormal, openLoop)
#pragma config(Motor,  port4,           RightDrive4,   tmotorNormal, openLoop)
#pragma config(Motor,  port5,           RightDrive5,   tmotorNormal, openLoop)
#pragma config(Motor,  port6,           Mech1,         tmotorNormal, openLoop)
#pragma config(Motor,  port7,           Mech2,         tmotorNormal, openLoop)
#pragma config(Motor,  port8,           Mech3,         tmotorNormal, openLoop)
#pragma config(Motor,  port9,           Mech4,         tmotorNormal, openLoop)
#pragma config(Motor,  port10,          RightDrive10,  tmotorNormal, openLoop)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

// Motors by default: + CW, - CCW
// Jumper IN  = 1 (touch)
// Jumper OUT = 0 (touch)
// Analog NOT PRESSED = 249; (touch as potentiometer; values are +-1)
// Analog PRESSED     = 5; (touch as potentiometer; values are +-1)

/*
jmp1  = 0: motor 1 flipped
jmp2  = 0: motor 2 flipped
jmp3  = 0: motor 3 flipped
jmp4  = 0: motor 4 flipped
jmp5  = 0: motor 5 flipped
jmp6  = 0: motor 6 flipped
jmp7  = 0: motor 7 flipped
jmp8  = 0: motor 8 flipped
jmp9  = 0: motor 9 flipped
jmp10 = 0: motor 10 flipped

jmp11 = 0 && jmp12 = 0: Single Driver TANK
jmp11 = 1 && jmp12 = 0: Dual Driver   TANK
jmp11 = 0 && jmp12 = 1: Single Driver ARCADE
jmp11 = 1 && jmp12 = 1: Dual Driver   ARCADE

ana1  < 200: motor 6 IGNORE CCW
ana2  < 200: motor 6 IGNORE CW
ana3  < 200: motor 7 IGNORE CCW
ana4  < 200: motor 7 IGNORE CW
ana5  < 200: motor 8 IGNORE CCW
ana6  < 200: motor 8 IGNORE CW
ana7  < 200: motor 9 IGNORE CCW
ana8  < 200: motor 9 IGNORE CW
*/


task main()
{
  int ana_1 = 0;
  int ana_2 = 0;
  int ana_3 = 0;
  int ana_4 = 0;
  int ana_5 = 0;
  int ana_6 = 0;
  int ana_7 = 0;
  int ana_8 = 0;

  while(true)
  {
    //GLOBAL CHANGES & CHECKS:
    bMotorReflected[LeftDrive1]   = SensorValue[jmp1];
    bMotorReflected[LeftDrive2]   = SensorValue[jmp2];
    bMotorReflected[LeftDrive3]   = SensorValue[jmp3];
    bMotorReflected[RightDrive4]  = SensorValue[jmp4];
    bMotorReflected[RightDrive5]  = SensorValue[jmp5];
    bMotorReflected[Mech1]        = SensorValue[jmp6];
    bMotorReflected[Mech2]        = SensorValue[jmp7];
    bMotorReflected[Mech3]        = SensorValue[jmp8];
    bMotorReflected[Mech4]        = SensorValue[jmp9];
    bMotorReflected[RightDrive10] = SensorValue[jmp10];

    if(SensorValue[ana1] < 200)
      ana_1 = 0;
    else
      ana_1 = 1;

    if(SensorValue[ana2] < 200)
      ana_2 = 0;
    else
      ana_2 = 1;

    if(SensorValue[ana3] < 200)
      ana_3 = 0;
    else
      ana_3 = 1;

    if(SensorValue[ana4] < 200)
      ana_4 = 0;
    else
      ana_4 = 1;

    if(SensorValue[jmp11] == 0 && SensorValue[jmp12] == 0)      // if !jmp11 && !jmp12:--------------------------------------| SINGLE DRIVER - TANK |--------------------------------------
    {
      if(SensorValue[ana5] < 200)
        ana_5 = 0;
      else
        ana_5 = 1;

      if(SensorValue[ana6] < 200)
        ana_6 = 0;
      else
        ana_6 = 1;

      if(SensorValue[ana7] < 200)
        ana_7 = 0;
      else
        ana_7 = 1;

      if(SensorValue[ana8] < 200)
        ana_8 = 0;
      else
        ana_8 = 1;

      motor[LeftDrive1]   = vexRT[Ch3];       // up = CW
      motor[LeftDrive2]   = vexRT[Ch3];       // up = CW
      motor[LeftDrive3]   = vexRT[Ch3];       // up = CW
      motor[RightDrive4]  = -vexRT[Ch2];      // up = CCW
      motor[RightDrive5]  = -vexRT[Ch2];      // up = CCW
      motor[Mech1]        = ((vexRT[Btn5U] * 127) * ana_2) - ((vexRT[Btn5D] * 127) * ana_1);   // U = CW, D = CCW
      motor[Mech2]        = ((vexRT[Btn6U] * 127) * ana_4) - ((vexRT[Btn6D] * 127) * ana_3);   // U = CW, D = CCW
      motor[Mech3]        = ((vexRT[Btn7U] * 127) * ana_6) - ((vexRT[Btn7D] * 127) * ana_5);   // U = CW, D = CCW
      motor[Mech4]        = ((vexRT[Btn8U] * 127) * ana_8) - ((vexRT[Btn8D] * 127) * ana_7);   // U = CW, D = CCW
      motor[RightDrive10] = -vexRT[Ch2];        // up = CCW
    }//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    else if(SensorValue[jmp11] == 1 && SensorValue[jmp12] == 0)    // if jmp11 && !jmp12:--------------------------------------| DUAL DRIVER - TANK |---------------------------------------
    {
      motor[LeftDrive1]   = vexRT[Ch3];       // up = CW
      motor[LeftDrive2]   = vexRT[Ch3];       // up = CW
      motor[LeftDrive3]   = vexRT[Ch3];       // up = CW
      motor[RightDrive4]  = -vexRT[Ch2];      // up = CCW
      motor[RightDrive5]  = -vexRT[Ch2];      // up = CCW
      motor[Mech1]        = ((vexRT[Btn5UXmtr2] * 127) * ana_2) - ((vexRT[Btn5DXmtr2] * 127) * ana_1);   // U = CW, D = CCW
      motor[Mech2]        = ((vexRT[Btn6UXmtr2] * 127) * ana_4) - ((vexRT[Btn6DXmtr2] * 127) * ana_3);   // U = CW, D = CCW

      if((SensorValue[ana_6] < 200 && vexRT[Ch3Xmtr2] > 0) || (SensorValue[ana_5] < 200 && vexRT[Ch3Xmtr2] < 0))
      {
        motor[Mech3]        = 0;
      }
      else
      {
        motor[Mech3]        = vexRT[Ch3Xmtr2];  // up = CW
      }

      if((SensorValue[ana_8] < 200 && vexRT[Ch2Xmtr2] > 0) || (SensorValue[ana_7] < 200 && vexRT[Ch2Xmtr2] < 0))
      {
        motor[Mech4]        = 0;
      }
      else
      {
        motor[Mech4]        = (vexRT[Ch2Xmtr2]);  // up = CW
      }

      motor[RightDrive10] = -vexRT[Ch2];        // up = CCW
    }//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    else if(SensorValue[jmp11] == 0 && SensorValue[jmp12] == 1)    // if !jmp11 && jmp12:------------------------------------| SINGLE DRIVER - ARCADE |-------------------------------------
    {
      motor[LeftDrive1]   = vexRT[Ch1] + vexRT[Ch2];       // up = CW, right = CW
      motor[LeftDrive2]   = vexRT[Ch1] + vexRT[Ch2];       // up = CW, right = CW
      motor[LeftDrive3]   = vexRT[Ch1] + vexRT[Ch2];       // up = CW, right = CW
      motor[RightDrive4]  = vexRT[Ch1] - vexRT[Ch2];       // up = CW, right = CCW
      motor[RightDrive5]  = vexRT[Ch1] - vexRT[Ch2];       // up = CW, right = CCW
      motor[Mech1]        = ((vexRT[Btn5U] * 127) * ana_2) - ((vexRT[Btn5D] * 127) * ana_1);   // U = CW, D = CCW
      motor[Mech2]        = ((vexRT[Btn6U] * 127) * ana_4) - ((vexRT[Btn6D] * 127) * ana_3);   // U = CW, D = CCW

      if((SensorValue[ana_6] < 200 && vexRT[Ch3] > 0) || (SensorValue[ana_5] < 200 && vexRT[Ch3] < 0))
      {
        motor[Mech3]        = 0;
      }
      else
      {
        motor[Mech3]        = vexRT[Ch3];  // up = CW
      }

      if((SensorValue[ana_8] < 200 && (-vexRT[Ch4]) > 0) || (SensorValue[ana_7] < 200 && (-vexRT[Ch4]) < 0))
      {
        motor[Mech4]        = 0;
      }
      else
      {
        motor[Mech4]        = (-vexRT[Ch4]);  // right = CCW
      }
      motor[RightDrive10] = vexRT[Ch1] - vexRT[Ch2];       // up = CW, right = CCW
    }//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    else if(SensorValue[jmp11] == 1 && SensorValue[jmp12] == 1)    // if jmp11 && jmp12:--------------------------------------| DUAL DRIVER - ARCADE |--------------------------------------
    {
      motor[LeftDrive1]   = vexRT[Ch1] + vexRT[Ch2];       // up = CW, right = CW
      motor[LeftDrive2]   = vexRT[Ch1] + vexRT[Ch2];       // up = CW, right = CW
      motor[LeftDrive3]   = vexRT[Ch1] + vexRT[Ch2];       // up = CW, right = CW
      motor[RightDrive4]  = vexRT[Ch1] - vexRT[Ch2];       // up = CW, right = CCW
      motor[RightDrive5]  = vexRT[Ch1] - vexRT[Ch2];       // up = CW, right = CCW
      motor[Mech1]        = ((vexRT[Btn5UXmtr2] * 127) * ana_2) - ((vexRT[Btn5DXmtr2] * 127) * ana_1);   // U = CW, D = CCW
      motor[Mech2]        = ((vexRT[Btn6UXmtr2] * 127) * ana_4) - ((vexRT[Btn6DXmtr2] * 127) * ana_3);   // U = CW, D = CCW

      if((SensorValue[ana_6] < 200 && vexRT[Ch3Xmtr2] > 0) || (SensorValue[ana_5] < 200 && vexRT[Ch3Xmtr2] < 0))
      {
        motor[Mech3]        = 0;
      }
      else
      {
        motor[Mech3]        = vexRT[Ch3Xmtr2];  // up = CW
      }

      if((SensorValue[ana_8] < 200 && vexRT[Ch2Xmtr2] > 0) || (SensorValue[ana_7] < 200 && vexRT[Ch2Xmtr2] < 0))
      {
        motor[Mech4]        = 0;
      }
      else
      {
        motor[Mech4]        = (vexRT[Ch2Xmtr2]);  // up = CW
      }

      motor[RightDrive10] = vexRT[Ch1] - vexRT[Ch2];       // up = CW, right = CCW
    }//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  }
}

_________________
Jesse Flot
CMU Robotics Academy
ROBOTC Support


Thu Oct 14, 2010 10:21 am
Profile
Site Admin
Site Admin

Joined: Thu Jul 05, 2007 12:45 pm
Posts: 35
Location: Carnegie Mellon
Post Re: I lost my default firmware
Jesse,

Is this program built into ROBOTC. If it is, where can the new user find it?

Thanks


Fri Oct 15, 2010 11:05 am
Profile WWW
Site Admin
Site Admin

Joined: Tue May 15, 2007 9:02 am
Posts: 405
Post Re: I lost my default firmware
It's included in ROBOTC versions 2.3 and up. Go to File > Open Sample Program > Advanced > ROBOTC VEX Cortex Default.c.

_________________
Jesse Flot
CMU Robotics Academy
ROBOTC Support


Fri Oct 15, 2010 11:58 am
Profile
Site Admin
Site Admin

Joined: Mon Jun 08, 2009 4:50 pm
Posts: 70
Post Re: I lost my default firmware
Hi,

I also believe that in version 2.3 and up when you download the ROBOTC Firmware, this program gets downloaded along with it. So users will have it by default. And as Jesse mentioned, if they ever want it again later, it can be found in the Advanced folder of the Sample Programs.

_________________
Bence Feher

Undergraduate Intern - NREC, Robotics Academy
ROBOTC - Testing/Documentation/Developer

Computer Science, Japanese, East Asian Studies
University of Pittsburgh, Konan University 甲南大学


Fri Oct 15, 2010 4:29 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 5 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


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.