|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Re: project startup vi
well, i want it to load with an initial vi that reads the keyboard input. Depending on if A or T is pressed, it will run either the tank drive vi or the arcade drive vi.
|
|
#2
|
|||||
|
|||||
|
Re: project startup vi
The Driver Station program does not pass keyboard information to the robot. You should think about other ways to select arcade vs. tank drive, such as a joystick button or a switch on the Cypress I/O board (which doesn't have to be a real switch; you can use the emulated I/O on the Driver Station tab).
Use a Case block to run either the Arcade or Tank drive functions. Which one gets run will depend on the select input to the Case, and that should come from the switch you've chosen. Does this help? |
|
#3
|
||||
|
||||
|
Re: project startup vi
oh, thought it would get keyboard. Ok. Can you explain "Case Block"?
|
|
#4
|
|||||
|
|||||
|
Re: project startup vi
Also called a case structure, this is basically equivalent to an if statement and a switch statement as found in some text based languages. Wire your selector value to the node on the left side of the rectangle and put the code you want to execute in each state in the corresponding subdiagram.
NI Reference |
|
#5
|
||||
|
||||
|
Re: project startup vi
oh, ok. Didn't recognize the name. I know what that is. The problem that i found was that it wouldn't keep the value. I fixed this by putting a while loop inside the case structure.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|