|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Re: Programming Potentiometer for Shooter
Ok so I have had success with programming this. Essentially what I did was in Teleop called the joystick vi's like you normally would when you want to do tank drive or other joystick related things and set the axis 1 as the shooting axis. The reason why I choose axis 1 is because on the board the analog inputs it gives you are call X, Y, Z, R. I assumed they all followed the the same in LV. This worked with great success but the problem I have is that when you turn the POT, you have a neutral position(zero position) where the shooter motor is not running and when you turn the knob to one side it goes forward and the other side spins the motor in reverse. Is there any way where I can take the values from from one extreme and use this as my starting position where the motor spins forward and increases the speed as you turn the knob?
|
|
#2
|
|||||
|
|||||
|
Re: Programming Potentiometer for Shooter
Joystick values range from -1 to +1. You want to run the value through a formula that produces an output from 0 to +1 before you feed that to the motor, right? That's easy: add one, then divide by two.
|
|
#3
|
|||
|
|||
|
Re: Programming Potentiometer for Shooter
Ahh, thanks for this, I completely forgot about adding one and dividing by two.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|