Go to Post Hyper, I want to marry your robot. - Keys [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 22-06-2013, 22:42
ekapalka's Avatar
ekapalka ekapalka is offline
Registered User
FRC #3216
 
Join Date: Dec 2012
Location: Bermuda
Posts: 277
ekapalka has a spectacular aura aboutekapalka has a spectacular aura about
Switching to Iterative

Hey! I've been working on some code that seems a bit too elaborate for the SimpleRobot template, so I wanted to try out Iterative. I looked for a template, and didn't find one, so then I searched the forum here, and found that the "BuiltinDefaultCode" is essentially the template, with a lot of code I'd probably never use mixed in. I realized that I actually know very little about FRC programming (or at least feel like it). Could someone please help explain a the different methods in the BuiltinDefaultCode (and some of the other things they threw into the code for kicks)? I've removed most of the "actual code" that I'm pretty sure isn't necessary (but I still have questions about), and this is what I was left with (in case it helps).
Code:
#include "WPILib.h"
class BuiltinDefaultCode : public IterativeRobot{
	UINT32 m_autoPeriodicLoops;
	UINT32 m_disabledPeriodicLoops;
	UINT32 m_telePeriodicLoops;
		
public:
	BuiltinDefaultCode(void){
		m_autoPeriodicLoops = 0;
		m_disabledPeriodicLoops = 0;
		m_telePeriodicLoops = 0;
	}	
	
	////Init Routines///
	
	void RobotInit(void) {
		/* Actions which would be performed once (and only once) 
		 *upon initialization of the robot would be put here  */
	}
	
	void DisabledInit(void) {
		m_disabledPeriodicLoops = 0;			// Reset the loop counter for disabled mode
		/**/
	}

	void AutonomousInit(void) {
		m_autoPeriodicLoops = 0;				// Reset the loop counter for autonomous mode
		/**/
	}

	void TeleopInit(void) {
		m_telePeriodicLoops = 0;
		/**/
	}

	////Periodic Routines////
	
	void DisabledPeriodic(void)  {
		/**/
	}

	void AutonomousPeriodic(void) {
		/**/
	}
	
	void TeleopPeriodic(void) {
		/**/
	} 

	////Continuous Routines////

	void DisabledContinuous(void) {
		/**/
	}

	void AutonomousContinuous(void)	{
		/**/
	}

	void TeleopContinuous(void) {
		/**/
	}		
};

START_ROBOT_CLASS(BuiltinDefaultCode);
Thanks!
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


All times are GMT -5. The time now is 12:22.

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