|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
check code
I just want you guys to review a code that a teammate wrote. He told me to write that added to the code is allowing the motor to spin at half speed if button 1 is pressed.
![]() |
|
#2
|
|||||
|
|||||
|
Re: check code
This code currently does not do anything different when the button is pressed. You want the motor to run at half speed or half the speed that the joystick commands when the button is pressed? The following assumes that you wanted the first option.
The 0.5 constant in the case statement is not connected to anything. For the false case of each case block the joystick axis value should pass through the case block. For the true case the 0.5 constant should be wired to the small orange block on the right edge of the case that will appear when you wire the joystick value through the false case. |
|
#3
|
|||
|
|||
|
Re: check code
edited to what I think you said.
![]() Last edited by zip100 : 08-02-2010 at 00:00. |
|
#4
|
|||||
|
|||||
|
Re: check code
Correct, the orange wire coming out of each block that says "axis 2(y)" should pass through the false case instead of over the case block.
|
|
#5
|
|||
|
|||
|
Re: check code
after going through the case block, does it go to the tank drive vi
Last edited by zip100 : 08-02-2010 at 00:09. |
|
#6
|
|||||
|
|||||
|
Re: check code
Oops, looks like a forgot to ask something on my first pass.
Do you want both motors to run at 1/2 speed by pushing one trigger (button 1)? Or do you want each side to run at 1/2 speed when the trigger is pressed on that sides joystick? The second one is what the code currently does. So ,for example, if the left trigger is pressed the left side will run at a constant .5 and the right side will still run according to the joystick. If both triggers are pressed, both sides will run at constant speed. Is that what you wanted? |
|
#7
|
|||
|
|||
|
Re: check code
wanted to both joysticks pressed for half speed. So does the second pic look okay.
|
|
#8
|
|||||
|
|||||
|
Re: check code
Yes, if you want each joystick and button #1 to control each side separately I believe the fixed code is correct.
|
|
#9
|
|||
|
|||
|
Re: check code
so i do not have to put in axis (y) in the true, only in the false. Also only one end is go9ng to the case structure of the constant. Does that look okay.
|
|
#10
|
|||||
|
|||||
|
Re: check code
Correct, when the button is pressed (true case) you want the motor to run at a constant speed so you do not need the joystick value.
The constant originates in the case so it only goes out, no need for anything to come in. |
|
#11
|
|||
|
|||
|
Re: check code
Thank you for the help, will test out tomorrow and reply on how it went.
|
|
#12
|
|||||
|
|||||
|
Re: check code
The first problem, I can't help with.
The ethernet port: If another cable also doesn't click, look carefully at the classmate's connector, make sure it's not broken. If another cable clicks & locks, then it was the cable end. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Code Declaration Window - Check Team in Code | DtD | C/C++ | 3 | 20-01-2009 07:09 |
| May I get a steering wheel and pedal code check? | windell747 | Programming | 1 | 11-02-2008 08:43 |
| Site Check | Sunny Thaper | Chit-Chat | 8 | 01-05-2002 19:03 |
| Please CHECK IN !!!! | RebAl | General Forum | 0 | 22-04-2002 17:21 |