Go to Post FIRST inspired me to become a pain in the patootie or something. :) - Madison [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 14-04-2010, 18:14
krudeboy51's Avatar
krudeboy51 krudeboy51 is offline
Only Programmer
AKA: kory
FRC #0369 (369)
Team Role: Programmer
 
Join Date: Mar 2010
Rookie Year: 2010
Location: brooklyn
Posts: 151
krudeboy51 is a glorious beacon of lightkrudeboy51 is a glorious beacon of lightkrudeboy51 is a glorious beacon of lightkrudeboy51 is a glorious beacon of lightkrudeboy51 is a glorious beacon of light
Send a message via AIM to krudeboy51
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??
Reply With Quote
  #2   Spotlight this post!  
Unread 14-04-2010, 19:14
Radical Pi Radical Pi is offline
Putting the Jumper in the Bumper
AKA: Ian Thompson
FRC #0639 (Code Red Robotics)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2010
Location: New York
Posts: 655
Radical Pi has a spectacular aura aboutRadical Pi has a spectacular aura aboutRadical Pi has a spectacular aura about
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
__________________

"To have no errors would be life without meaning. No strugle, no joy"
"A network is only as strong as it's weakest linksys"
Reply With Quote
  #3   Spotlight this post!  
Unread 14-04-2010, 19:15
Al3+'s Avatar
Al3+ Al3+ is offline
ARTist
AKA: Anthony
FRC #0840 (Aragon Robotics Team)
Team Role: Programmer
 
Join Date: Oct 2009
Rookie Year: 2008
Location: San Mateo, CA
Posts: 58
Al3+ is a jewel in the roughAl3+ is a jewel in the roughAl3+ is a jewel in the rough
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.
__________________
cout << "Hello, robotics. Goodbye, world." << endl;

"The two-axis accelerometer provided in the kit of parts (shown in the picture below) is a two-axis accelerometer." - WPILib User's Guide
Reply With Quote
  #4   Spotlight this post!  
Unread 14-04-2010, 19:59
Tom Bottiglieri Tom Bottiglieri is offline
Registered User
FRC #0254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Jan 2004
Rookie Year: 2003
Location: San Francisco, CA
Posts: 3,187
Tom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond repute
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) {...}

Last edited by Tom Bottiglieri : 14-04-2010 at 20:02.
Reply With Quote
  #5   Spotlight this post!  
Unread 14-04-2010, 21:37
nighterfighter nighterfighter is offline
1771 Alum, 1771 Mentor
AKA: Matt B
FRC #1771 (1771)
Team Role: Mentor
 
Join Date: Sep 2009
Rookie Year: 2007
Location: Suwanee/Kennesaw, GA
Posts: 835
nighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant future
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!)
Reply With Quote
  #6   Spotlight this post!  
Unread 15-04-2010, 14:14
krudeboy51's Avatar
krudeboy51 krudeboy51 is offline
Only Programmer
AKA: kory
FRC #0369 (369)
Team Role: Programmer
 
Join Date: Mar 2010
Rookie Year: 2010
Location: brooklyn
Posts: 151
krudeboy51 is a glorious beacon of lightkrudeboy51 is a glorious beacon of lightkrudeboy51 is a glorious beacon of lightkrudeboy51 is a glorious beacon of lightkrudeboy51 is a glorious beacon of light
Send a message via AIM to krudeboy51
Re: AUTONOMOUS PROBLEM

Quote:
Originally Posted by Radical Pi View Post
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!
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
Autonomous Problem wakeboard.dude NI LabVIEW 3 26-01-2010 15:55
Autonomous problem railerobotics Programming 7 07-02-2006 08:36
Autonomous Problem... JoeFryman Programming 2 19-02-2005 14:56
PWM problem in autonomous outofcontrol Programming 5 27-02-2004 11:58
Autonomous problem. Code\\Pilot Programming 8 10-02-2004 19:40


All times are GMT -5. The time now is 03:23.

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