|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#5
|
|||
|
|||
|
Re: encoders
Since the encoder may have ticked before you hit this block of code, you may want to do something like this.
Code:
//define a variable outside the loop called 'temp1'
if(temp1==0)
{
temp1=Get_Left_Encoder_Count();
}
static long lec = Get_Left_Encoder_Count() - temp1;
if (lec >= 12)
{
pwm02 = 127; //set it to neutral
}
else
{
pwm02 = p3_y;
}
Last edited by Tom Bottiglieri : 12-01-2005 at 15:41. |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Mechanical Wheel Encoders? | Jaine Perotti | Electrical | 15 | 04-12-2004 22:46 |
| Shaft Encoders | wun | Programming | 3 | 12-10-2004 16:40 |
| encoders? what kind and where from? | ajlapp | Electrical | 1 | 03-02-2004 01:49 |
| Who used wheel encoders | CyberWolf_22 | Technical Discussion | 12 | 04-05-2003 15:37 |