Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   C/C++ (http://www.chiefdelphi.com/forums/forumdisplay.php?f=183)
-   -   AUTONOMOUS PROBLEM (http://www.chiefdelphi.com/forums/showthread.php?t=85239)

krudeboy51 14-04-2010 18:14

AUTONOMOUS PROBLEM
 
I HAVE A PROBLEM, I WROTE THIS CODE FOR AUTONOMOUS:

Quote:

if ((AutoSwitch3->Get()== 1) && (limitSwitchB->Get()== 1))
{
CamKicker->Set(1.0);
Wait(1.0);
CamKicker->Set(0.0);
}
when the third switch on the robot is on it sets the cam kicker. before the camKicker is being is set it is pressing limitswitchb.

but its not working, can anyone help please??

Radical Pi 14-04-2010 19:14

Re: AUTONOMOUS PROBLEM
 
no, the logic in his if is right. Double-check that the switches are actually sending data. Nothing that I can see with that code seems wrong

Al3+ 14-04-2010 19:15

Re: AUTONOMOUS PROBLEM
 
The if statement looks fine to me.

Try outputting the values of AutoSwitch3->Get() and limitSwitchB->Get(). Make sure something odd isn't going on.

Tom Bottiglieri 14-04-2010 19:59

Re: AUTONOMOUS PROBLEM
 
Digital inputs are pulled up (to a logic high... 1). When you short the signal line to ground the input will read as logic low, or 0.

Try doing
Code:

if(switch->Get() == 0) {...}

nighterfighter 14-04-2010 21:37

Re: AUTONOMOUS PROBLEM
 
Also make sure your wiring on the switches are correct.

We had a switch wired backwards, so every time it was triggered, it shorted the IO Board, causing all of our stuff to stop.

(And they blamed it on the programming!)

krudeboy51 15-04-2010 14:14

Re: AUTONOMOUS PROBLEM
 
Quote:

Originally Posted by Radical Pi (Post 953781)
no, the logic in his if is right. Double-check that the switches are actually sending data. Nothing that I can see with that code seems wrong

did that! :confused:


All times are GMT -5. The time now is 13:00.

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