|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#16
|
|||||
|
|||||
|
Re: [FTC]: Robot C
Yeah the programming Gods like you to do that it's really just unessesary code, and yeah it's been a long day i know i forgot the loop XD.
|
|
#17
|
|||||
|
|||||
|
Re: [FTC]: Robot C
Quote:
{ code for what you want to happen here } else { code to make that stop happening } this is still as efficiant i tried it today. |
|
#18
|
|||
|
|||
|
Re: [FTC]: Robot C
Quote:
You need to understand that a boolean true/false in ROBOTC is the same as 1 or 0 where 'true' is the same as '1' and 'false' is the same as '0'. Therefore the follow statements are all logically equivalent: Code:
if(value == true) if(value == 1) if(value != false) if(value != 0) So as long as the value variable in our example here is already a boolean, there is no need to explicitly check it for truth. That is there is no need to explicitly test if true is equal to true of if false is equal to false... just pass the boolean itself to the if() statement like: Code:
if(value) Well because those functions return a boolean. That means when you call the function you get back either a true or a false and there is no need to see if that is not equal to 0. Just test against the returned boolean like: Code:
if(joy1Btn(1))
{
//do stuff
}
Hope this clears us some of the fog. ![]() |
|
#19
|
||||
|
||||
|
Re: [FTC]: Robot C
ahh i see... yeah that makes sense... i guess my brain is just wired in some screwed up way haha
|
|
#20
|
|||||
|
|||||
|
Re: [FTC]: Robot C
Quote:
![]() |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [FTC]: Power Surge Robot | Nitro-Guy | FIRST Tech Challenge | 7 | 21-05-2009 10:30 |
| [FTC]: FTC Futures Forum at FTC World Championship | gdo | FIRST Tech Challenge | 0 | 08-04-2009 18:46 |
| [FTC]: FTC]: FTC Champ Tournament - Ontario (Scoring Breakdown) | Mr. Lim | FIRST Tech Challenge | 2 | 03-03-2008 11:54 |
| pic: FTC #3 robot design | Techno-Turkey | Extra Discussion | 5 | 06-02-2008 08:07 |
| [FTC]: [FTC]: Ontario Provincial FTC Start/End Times | cbhl | FIRST Tech Challenge | 8 | 16-12-2007 13:37 |