Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Programming help go foward but not reverse (http://www.chiefdelphi.com/forums/showthread.php?t=81419)

Tds123 29-01-2010 12:26

Programming help go foward but not reverse
 
Here is my robots code...

http://paste.pocoo.org/show/171676/

The spike that run " winch"
and the spike runs "roller" the button that makes it go foward works but the buttons that make it go in reverse dont work...please help with this someone!!!

and the jaguar for arm... when both buttons are pressed the jaguar turns green one of them is supposed to be red for reverse...

byteit101 29-01-2010 16:56

Re: Programming help go foward but not reverse
 
you are turning it off
Code:

if (armjoy.GetRawButton(outtakeButton) == 1) {
                        roller.SetDirection(Relay::kForwardOnly);
                        roller.Set(Relay::kOn);
                } else if (armjoy.GetRawButton(intakeButton) == 1) {
                        roller.SetDirection(Relay::kReverseOnly);
                        roller.Set(Relay::kOn);//not kOff
                } else {
                        roller.Set(Relay::kOff);
                }

        if (armjoy.GetTrigger() == 1) {
                                winch.SetDirection(Relay::kForwardOnly);
                                winch.Set(Relay::kOn);
                } else if (armjoy.GetRawButton(winchDownButton) == 1) {
                                winch.SetDirection(Relay::kReverseOnly);
                                winch.Set(Relay::kOn);//not kOff
                } else {
                                winch.Set(Relay::kOff);
                }



All times are GMT -5. The time now is 01:54.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi