Go to Post This is far more then any little school extracurricular, this is a FIRST Robotics Team. - onecoolc [more]
Home
Go Back   Chief Delphi > FIRST > General Forum
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 22-02-2011, 23:25
davidthefat davidthefat is offline
Alumni
AKA: David Yoon
FRC #0589 (Falkons)
Team Role: Alumni
 
Join Date: Jan 2011
Rookie Year: 2010
Location: California
Posts: 792
davidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud of
Re: Java to Labview, using "if else" statements and pressing buttons

x=reader.nextInt();
claw = !x;

There you go, I optimized it.
__________________
Do not say what can or cannot be done, but, instead, say what must be done for the task at hand must be accomplished.

Last edited by davidthefat : 22-02-2011 at 23:26. Reason: I forgot x=reader.nextInt();
Reply With Quote
  #2   Spotlight this post!  
Unread 23-02-2011, 00:31
WizenedEE's Avatar
WizenedEE WizenedEE is offline
Registered User
AKA: Adam
FRC #3238 (Cyborg Ferrets)
Team Role: Leadership
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Anacortes, WA
Posts: 395
WizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to all
Re: Java to Labview, using "if else" statements and pressing buttons

I'm assuming you know about case structures.

To make an else if statement, you just go to the false case of the case structure and put another case structure inside that.

There are also other ways to do it, like taking all your inputs and making them into a number (with a boolean array to number function, if you're interested) and wiring that one number to the structure. However, it's easiest (although ugliest) to just nest the case structures.

I attached an optimized program for you.
Attached Thumbnails
Click image for larger version

Name:	Program Example.JPG
Views:	150
Size:	16.0 KB
ID:	10276  
Reply With Quote
  #3   Spotlight this post!  
Unread 24-02-2011, 20:59
Lemonsy Lemonsy is offline
Registered User
FRC #3028
 
Join Date: Feb 2011
Location: Hidalgo, Texas
Posts: 2
Lemonsy is an unknown quantity at this point
Re: Java to Labview, using "if else" statements and pressing buttons

Oh wow, thanks! I've tested both of them, but I need to discuss with my driver and team which they would prefer.

Much appreciated
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


All times are GMT -5. The time now is 09:56.

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