Go to Post I design gears and gear boxes for a living. I am HAPPY to write a check and have a solution in mailed to me. - Joe Johnson [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 09-02-2008, 11:58
Shivang1923 Shivang1923 is offline
I make robot go VROOM VROOM!
FRC #1923 (MidKnight Inventors)
Team Role: Programmer
 
Join Date: Feb 2008
Rookie Year: 2008
Location: West Windsor, NJ
Posts: 38
Shivang1923 has a spectacular aura aboutShivang1923 has a spectacular aura about
ROBOTC help

Hey. I'm having trouble programing a ROBOTC code into the RC. I keep getting this error:

Robot controller failed to respond

Possibly not powered on or corrupted firmware
Or low battery connection
or cable connections between controller and PC are wrong
Or incorrect port is selected on PC
Or FRC controller is not connected via tether or radio

-I checked every single one of these things and nothing fixes this error.
Heres the code I am using--

Code:
#include "FRC_Comp_Include.c"

void Initialization()
{
	bMotorReflected[port2] = true;
}

task Autonomous()
{
	motor[port1] = 30;
	motor[port2] = 30;
	wait1Msec(500);
	motor[port1] = 0;
	motor[port2] = 0;
}

task Human_Control()
{
		while(true)
		{
		motor[port1] = frcRF[p1_y];
		motor[port2] = frcRF[p2_y];
	}
}
the FRC_Comp_Include.c code is

Code:
void Initialization();
task Autonomous();
task Human_Control();

task main()
{
	bool bCurrentPhase;

	//
	// Run the user initialization function
	//
	Initialization();

	bCurrentPhase = !bIfiAutonomousPhase; // This will ensure that task will be started first time through

	//
	// Loop forever checking to see if the phase has changed
	//
	while (true)
	{
		//
		// Need to check whether the phase has switched. We only want to do action when a change has occurred.
		// This is because the "StartTask" function will either start a task running or restart an existing running task!
		//
		if (bCurrentPhase != bIfiAutonomousPhase)
		{
			//
			// Need to switch phases
			//
			//   1. Always stop the current task first
			//   2. Then start the new task.
			//
			// If you start the "new" task before stopping the current task, then for a brief time you may have both tasks
			// running simultaneously.
			//
			bCurrentPhase = bIfiAutonomousPhase;

			if (bCurrentPhase)
			{
				StopTask(Human_Control);
				StartTask(Autonomous);
			}
			else
			{
				StopTask(Autonomous);
				StartTask(Human_Control);
			}
		}

		// Delay a little so this task minimizes it's CPU execution time. Otherwise it will take 50% of the CPU time and
		// slow down the "Autonomous" or "Human_Control" tasks which are doing the "real" time.

		wait1Msec(20);
	}
}
  #2   Spotlight this post!  
Unread 09-02-2008, 13:10
Woody1458's Avatar
Woody1458 Woody1458 is offline
AKA: Woody Jansen
FRC #1458 (Danvillans)
Team Role: Engineer
 
Join Date: Oct 2006
Rookie Year: 2006
Location: Danville, California
Posts: 286
Woody1458 is a splendid one to beholdWoody1458 is a splendid one to beholdWoody1458 is a splendid one to beholdWoody1458 is a splendid one to beholdWoody1458 is a splendid one to beholdWoody1458 is a splendid one to beholdWoody1458 is a splendid one to behold
Send a message via AIM to Woody1458
Re: ROBOTC help

Is the RC in program mode? hold down the program button.
__________________
"Everything we produce is made of: Duct Tape, zip ties, and hope" - Christian Allinson 1458

Anyone can watch Westcoast Choppers and see adults build things, but FIRST is great because it encourages kids to do the building and adults to do the watching.

GO DANVILLANS!!
  #3   Spotlight this post!  
Unread 09-02-2008, 13:11
psy_wombats's Avatar
psy_wombats psy_wombats is offline
Registered User
AKA: A. King
FRC #0467 (Duct Tape Bandits)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Shrewsbury MA
Posts: 95
psy_wombats has a spectacular aura aboutpsy_wombats has a spectacular aura aboutpsy_wombats has a spectacular aura about
Re: ROBOTC help

I doubt that you have a coding problem, it seems that the downloading is the problem. Usually when I get this problem, I either have two IFI Loaders open or haven't compiled the code after cleaning it. Are either of those two the case? Otherwise, how did you test the items listed?
  #4   Spotlight this post!  
Unread 09-02-2008, 13:19
rpgcubed's Avatar
rpgcubed rpgcubed is offline
Registered User
AKA: Nick
FRC #2456 (Recycle-It!)
Team Role: Programmer
 
Join Date: Jan 2008
Rookie Year: 2008
Location: Marin
Posts: 4
rpgcubed is an unknown quantity at this point
Re: ROBOTC help

Whatever you do, do not press the program button. That deletes the ROBOTC Firmware and requires you to redownload it. If you do need to download it, it's under the Robot heading. Also you could try reconfiguring the COM port under View -> Preferences.
__________________
"The scientists of today think deeply instead of clearly. One must be sane to think clearly, but one can think deeply and be quite insane."
Nikola Tesla (1857 - 1943)
Closed Thread


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
Free ROBOTC for all 2008 FIRST Robotics Teams! Brandon Martus Announcements 12 01-02-2008 11:22
Setting up an analog input in RobotC for IFI. NSolarz Programming 2 30-01-2008 20:23
ROBOTC - Controller ShawnHanna Programming 1 30-01-2008 20:20
Free ROBOTC for all 2008 FIRST Robotics Teams! timville Programming 0 09-01-2008 10:27
Congrats to the Robotc Knights! MattB703 Thanks and/or Congrats 0 18-03-2002 15:07


All times are GMT -5. The time now is 07:35.

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