|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#2
|
|||
|
|||
|
Re: encoders
What does the robot do when you move the joystick? Have you tried turning the encoder by hand and printing the value of lec to make sure its being incremented correctly?
Since the call to Get_Left_Encoder_Count() does not reset the internal value, your local variable (lec) will saturate very quickly. Once the encoder moves one tick it will increment lec over 12 almost instantly. You either need to reset the value to 0 or use Get_Left_Encoder_Count() on its own as your counter. Code:
if (Get_Left_Encoder_Count() >= 12)
{
pwm02 = 127;
}
{
pwm02 = p3_y;
}
Last edited by seanwitte : 12-01-2005 at 15:38. |
| 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 |