|
Re: How do I program this sensor?
switch(count)
{
case 1:
//all your if count == 1 here
break;// never ever ever forget to put this . .ever
case 2:
//all your if count == 2 here
break; //EVER
case 3:
.
.
.
.
.
case 8:
//blah
break;
}
also for bidirectional I would have something like this before incrementing the count
if(pwm13 >= 127)
count++;
else
count--;
also when you stop the motor and "remap it" to the joy . .you wont see a stop. it will set pwm13 to 127 then set it to what ever the joy is at when it stopped in the next line. so youll have to figure a way to pause it for a sec(I would suggest using 2 digital buttons one for step up a notch and one for step down . .and some way of overriding)
__________________
Proud mentor of Team #1745 the P-51 Mustangs
If at first it doesn't work, use a hammer.
If that doesn't work, use a bigger hammer.
|