FIRST Forums  

Go Back   FIRST Forums > General Discussions > FIRST Programs > FIRST Robotics Competition > Competition Discussion > Programming > LabView

Reply
 
Thread Tools
  #1  
Old 02-22-2011, 11:19 PM
Lemonsy Lemonsy is offline
Junior Member
 
Join Date: Jan 2011
Posts: 5
Question Java to Labview, using "if else" statements and pressing buttons

I'm originally a java programmer, but I've taken on Labview since this past last year. I'm trying to make a code that will assign a value of 0 when a button ( button 1) is pressed and then change that value into a 1. When the button is then pressed again the value is changed back into a 0.

This code is for a claw that will open and close. Any advice, help, or screenshots?

int x=reader.nextInt(); // takes value of pressing the claw button
while (y==1) //the robot is turned on
{
if(x==-1)
{
claw=0; //open position
}
else(x==0)
{
claw=1; //close position
}

x=reader.nextInt(); //checks the next value of the claw button
y=OnOrOff.nextInt() //checks if robot is on or off
}
Reply With Quote
  #2  
Old 02-26-2011, 09:40 PM
Mr. Roboto Beefy Head Mr. Roboto Beefy Head is offline
Junior Member
 
Join Date: Jan 2010
Location: Wisconsin
Posts: 25
Default Re: Java to Labview, using "if else" statements and pressing buttons

A good way to do that would be to have one case structure for if the motor should move and if it should move then have a case structure inside of that to decide what direction the motor should move
Reply With Quote
Reply

Tags
buttons, if else, java, labview


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:44 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.