Quote:
|
Originally Posted by amateurrobotguy
In order to be able to use a victor to control my motor, wouldn't I have to recallibrate it so it can go negative and be on a -1->1 scale as compared to 0->255?
If I decide to hook up a spike, I am assuming that it will be hooked up in a similar fashion to the victor.
|
You were talking about digital inputs before, a digital input is just anything tht return 0 or 1 (not -1). I know the relays has three states tht because u can actually have 3 states by having no signal, positive signal and negative signal. However, for you purpose lets think about the joystick button as a digital input since its 1 when its pressed and 0 when its reverse. Your code should be something like this:
Code:
If p1_sw_aux1==1
{
pwmX=255;
}
else if p1_sw_aux2==1
{
pwmX=0;
}
else
{
}
Note*: My syntax might not be correct, this program will not work properly is you press both buttons and the same time.