Thread: Autonomous
View Single Post
  #6   Spotlight this post!  
Unread 14-02-2009, 07:35
byteit101's Avatar
byteit101 byteit101 is offline
WPILib maintainer (WPI)
AKA: Patrick Plenefisch
no team (The Cat Attack (Formerly))
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Worcester
Posts: 699
byteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of light
Re: Autonomous

Quote:
Originally Posted by Alan Anderson View Post
That means supplying your own RobotMain() procedure, I think.
no, you can say something like this:
Code:
class RobotDemo: public SimpleRobot
{
        DriverStation *ds;
int pos;
    public:
        RobotDemo()
        {
             ds = DriverStation::GetInstance();
             if (ds->Get...
             //switch code here and assign pos 1,2, or 3
        }

        void Autonomous()
        {
             switch(pos)
{
case 1:
              Auto1();
...
}
        }
        void Auto1()
        {

        }
        void Auto2()
        {

        }
        void Auto2()
        {

        }
}
__________________
Bubble Wrap: programmers rewards
Watchdog.Kill();
printf("Watchdog is Dead, Celebrate!");
How to make a self aware robot: while (∞) cout<<(sqrt(-∞)/-0);
Previously FRC 451 (The Cat Attack)
Now part of the class of 2016 at WPI & helping on WPILib