Generally when posting asking for help its a good idea to include any and ALL errors you get. You had a number of "{" and "}" that didn't match up. Most of your problems stemmed from the fact that you weren't closing some of your functions, and while loops and such.
Also, if you use [ CODE] and [ /CODE] without the spaces, when posting code, it stays indented making it easier to read.
Code:
#include "WPILib.h"
class RobotDemo : public SimpleRobot
{
static const float Kp = 0.03;
RobotDrive myRobot;
Gyro gyro;
public:
RobotDemo(void): myRobot(1, 2), // these must be initialized in the same order
gyro (1)
{
myRobot.SetExpiration(0.1);
}
void Autonomous(void) {
gyro.Reset();
while (IsAutonomous())
{
DriverStationLCD *screen = DriverStationLCD::GetInstance();
float angle = gyro.GetAngle(); // current heading (0 = target)
myRobot.Drive(-1.0, -angle / 30.0); // proportionally drive in a straight line
Wait(0.004);
screen->PrintfLine(DriverStationLCD::kUser_Line1,"KimpeeA ngle", gyro.GetAngle());
screen->UpdateLCD();
Wait(0.1);
}
myRobot.Drive(0.0, 0.0);
}
};
START_ROBOT_CLASS(RobotDemo);