Go to Post It made me proud to know that we have corporate sponsors with genuine interest. - galewind [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 03-08-2009, 08:58 AM
awad1992 awad1992 is offline
Registered User
FRC #1946
 
Join Date: Dec 2008
Location: israel
Posts: 3
awad1992 is an unknown quantity at this point
help with c++ code

hello!
im from team 1946 in israel i just want to ask if we can do more than one (else if) in the same code

in other words , is it correct ?

if(!limitswitch1->Get())
jaguar1->Set(0.0);
Wait(0.05);
jaguar1->Set(0.5);
Wait(0.5);
jaguar1->Set(0.0);
else if (!limitswitch2->Get())
jaguar1->Set(0.0);
Wait(0.05);
jaguar1->Set(-0.5);
Wait(0.5);
jaguar1->Set(0.0);
else if (!limitswitch3 & leftStick->GetRawButton(10)
jaguar1->Set(0.0);
else jaguar1->Set(leftStick->GetZ() );

thanks
Reply With Quote
  #2   Spotlight this post!  
Unread 03-08-2009, 12:39 PM
byteit101's Avatar
byteit101 byteit101 is offline
WPILib maintainer (WPI)
AKA: Patrick Plenefisch
no team (The Cat Attack (Formerly))
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Worcester
Posts: 699
byteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of light
Re: help with c++ code

if(!limitswitch1->Get())
{
jaguar1->Set(0.0);
Wait(0.05);
jaguar1->Set(0.5);
Wait(0.5);
jaguar1->Set(0.0);
}
else if (!limitswitch2->Get())
{
jaguar1->Set(0.0);
Wait(0.05);
jaguar1->Set(-0.5);
Wait(0.5);
jaguar1->Set(0.0);
}
else if (!limitswitch3 & leftStick->GetRawButton(10))
{
jaguar1->Set(0.0);
}
else
{
jaguar1->Set(leftStick->GetZ() );
}
yes, as long as you have {}
__________________
Bubble Wrap: programmers rewards
Watchdog.Kill();
printf("Watchdog is Dead, Celebrate!");
How to make a self aware robot: while (∞) cout<<(sqrt(-∞)/-0);
Previously FRC 451 (The Cat Attack)
Now part of the class of 2016 at WPI & helping on WPILib
Reply With Quote
  #3   Spotlight this post!  
Unread 03-08-2009, 01:18 PM
awad1992 awad1992 is offline
Registered User
FRC #1946
 
Join Date: Dec 2008
Location: israel
Posts: 3
awad1992 is an unknown quantity at this point
Re: help with c++ code

thank you very much
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
HELP WITH CODE!!! :( nick_champ_2 Technical Discussion 6 01-16-2009 01:57 AM
Help with Hybrid code ShotgunNinja Programming 1 02-15-2008 01:42 PM
Help with VB code Setsanto Programming 8 02-08-2007 04:04 PM
Help with code b-rant Programming 1 04-05-2006 01:52 PM
hey need some help with writing a code please help me here magical hands Programming 9 01-01-2004 09:46 PM


All times are GMT -5. The time now is 10:32 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