|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Need help in c++ and windriver
Im new to programming in c++ and using the windriver enviornment. I was wondering if any one could post example drivecode (I read the simple robot code and it did not work when I downloaded it).
ThanK you in advance!!! |
|
#2
|
||||
|
||||
|
Re: Need help in c++ and windriver
Are you using the SimpleTemplate example? What kind of drive are you planning on? Arcade drive? Tank drive? How many motors, and do you have your control system all wired up? And have you looked at the documentation?
http://www.chiefdelphi.com/forums/sh...ad.php?t=71498 |
|
#3
|
|||
|
|||
|
Re: Need help in c++ and windriver
yes we used the simple template.... we are planning on using tank drive... we have 4 motors...yes the control system is wired up
Thankyou |
|
#4
|
||||
|
||||
|
Re: Need help in c++ and windriver
Read up on the documentation for different objects. You need to create objects for the different things you are using, then you need to define where they are plugged in, then just implement them in the operator control. I would suggest reading up, look in this folder for documentation
C:\windriver\docs\extensions\FRC\ here is an example adapted from the simple robot example: Code:
class RobotDemo : public SimpleRobot
{
RobotDrive* myRobot; // robot drive system
Joystick* m_leftStick;
Joystick* m_rightStick;
public:
RobotDemo(void)
{
GetWatchdog().SetExpiration(100);
//candidates are RobotDrive( LeftFront, LeftRear, RightFront, RightRear);
myRobot = new RobotDrive(1,3,2,4); //adapt to what yours are
m_leftStick = new Joystick(1); //once again adapt these to what you have
m_rightStick = new Joystick(2);
}
void Autonomous(void)
{
while (IsAutonomous())
{
GetWatchdog().Feed();
//auton code here
}
}
void OperatorControl(void)
{
GetWatchdog().SetEnabled(true);
while (IsOperatorControl())
{
GetWatchdog().Feed();
myRobot->TankDrive(m_leftStick, m_rightStick);
}
}
};
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| help:Downloading the project in windriver | mahmosh | C/C++ | 5 | 01-10-2009 10:08 AM |
| WindRiver Installation Issues - can you help a brother out? | tdressel | C/C++ | 1 | 01-08-2009 12:42 AM |
| Need interupts help, and another question... | Kevin Karan | Programming | 7 | 02-22-2004 11:20 AM |
| We NEED 8-inch wheels and programming help | archiver | 2001 | 7 | 06-24-2002 12:29 AM |