Go to Post Don't rely on the field staff to get every ball to work with your machine....engineer a robot that makes the change not matter. - PayneTrain [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 07-29-2010, 01:33 PM
Rangel(kf7fdb)'s Avatar
Rangel(kf7fdb) Rangel(kf7fdb) is offline
John Rangel
FRC #0842 (Falcon Robotics)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2009
Location: Phoenix, AZ
Posts: 713
Rangel(kf7fdb) has a reputation beyond reputeRangel(kf7fdb) has a reputation beyond reputeRangel(kf7fdb) has a reputation beyond reputeRangel(kf7fdb) has a reputation beyond reputeRangel(kf7fdb) has a reputation beyond reputeRangel(kf7fdb) has a reputation beyond reputeRangel(kf7fdb) has a reputation beyond reputeRangel(kf7fdb) has a reputation beyond reputeRangel(kf7fdb) has a reputation beyond reputeRangel(kf7fdb) has a reputation beyond reputeRangel(kf7fdb) has a reputation beyond repute
How to make backwards forward?

Hello, I am new to programming and on my robot we have 4 wheels. The only problem is that the front wheels are backwards so when we try and go forward with all 4 wheels, the front wheels go backwards while the back wheels go forward. How would we make the robot's front wheels go backwards while the back wheels go forward and vice versa. Here is what our code looks like. Sorry about the format.

#include

"WPILib.h"
/**

* This is a demo program showing the use of the RobotBase class.

* The SimpleRobot class is the base of a robot application that will automatically call your

* Autonomous and OperatorControl methods at the right time as controlled by the switches on

* the driver station or the field controls.

*/

class

RobotDemo : public SimpleRobot
{

RobotDrive myRobot; // robot drive system
Joystick stick; // only joystick
public

:
RobotDemo(

void):
myRobot(1, 2, 3, 4), // these must be initialized in the same order
stick(1) // as they are declared above.
{

GetWatchdog().SetExpiration(0.1);
}

/**
* Drive left & right motors for 2 seconds then stop

*/

void Autonomous(void)
{

GetWatchdog().SetEnabled(false);
myRobot.Drive(0.5, 0.0); // drive forwards half speed
Wait(2.0); // for 2 seconds
myRobot.Drive(0.0, 0.0); // stop robot
}

/**
* Runs the motors with arcade steering.

*/

void OperatorControl(void)
{

GetWatchdog().SetEnabled(true);
while (IsOperatorControl())
{

GetWatchdog().Feed();
myRobot.ArcadeDrive(stick); // drive with arcade style (use right stick)
Wait(0.005); // wait for a motor update time
}

}

};

START_ROBOT_CLASS(RobotDemo);
__________________
2011-2014 Arizona Regional Winners
2012 Dean's List Winner
2012-2013 Team President
2013 8th Place Robosub Competition
2014-? Mentor


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to make a .lib? duane Programming 1 02-16-2008 02:25 AM
How Do You Make a PB & J? JaneYoung Chit-Chat 39 10-07-2006 07:59 PM
How to make a MAVERICK shirt. Corey Balint General Forum 6 04-20-2006 12:44 AM
Help how to make a forum was217now1509 Website Design/Showcase 12 02-25-2005 10:37 PM
How to make a max speed Team 668 Programming 3 02-02-2005 05:54 PM


All times are GMT -5. The time now is 10:40 AM.

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