Go to Post I love you ChiefDelphi times! - Amanda Morrison [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

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 29-07-2010, 13:33
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: 718
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
  #2   Spotlight this post!  
Unread 29-07-2010, 13:52
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: How to make backwards forward?

You can either reverse the wiring or invert the motor direction in software. This thread has the detailed answers you need.
Reply With Quote
Reply


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 16-02-2008 02:25
How Do You Make a PB & J? JaneYoung Chit-Chat 39 07-10-2006 19:59
How to make a MAVERICK shirt. Corey Balint General Forum 6 20-04-2006 00:44
Help how to make a forum was217now1509 Website Design/Showcase 12 25-02-2005 22:37
How to make a max speed Team 668 Programming 3 02-02-2005 17:54


All times are GMT -5. The time now is 02:49.

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