|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Encoder Problem
I am using four grayhill encoders for our robot that uses a mecanum drive system. I am using the frc_encoder code from kevin watson. When I download the code unmodified it works just fine and all the encoders give me a reading. When I copy and paste the mecanum drive code into the encoder code only one of the encoders gives me a reading. Any help is much appreciated.
|
|
#2
|
||||
|
||||
|
Re: Encoder Problem
Can you post the code that doesn't work?
|
|
#3
|
|||
|
|||
|
Re: Encoder Problem
Attached to this message is the user routines file that doesn't work.
|
|
#4
|
|||
|
|||
|
Re: Encoder Problem
At a quick glance I dont see anything wrong. To confirm, your sayng when you comment out/dont run Default_Routine() that all 4 encoders work but when you run it only 1 does?
|
|
#5
|
|||||
|
|||||
|
Re: Encoder Problem
Quote:
How does this code differ from what does work? |
|
#6
|
||||
|
||||
|
Re: Encoder Problem
Quote:
|
|
#7
|
|||
|
|||
|
Re: Encoder Problem
I have tried commenting out the calll to default routine but it still only will read one encoder. The only difference between my code and the frc_encoder code ist that I have added some mecanum drive code for our robot.
|
|
#8
|
|||
|
|||
|
Re: Encoder Problem
Could you please post both copies of your code for us to look at.
|
|
#9
|
||||
|
||||
|
Re: Encoder Problem
Did you add code any where else besides user_routines?
|
|
#10
|
|||
|
|||
|
Re: Encoder Problem
The new user routines is the one from my earlier post and the old user routines is attached to this message and the only thing i edited between the two codes is the addition of the mecanum drive code.
|
|
#11
|
||||
|
||||
|
Re: Encoder Problem
Have you tried putting in the frc_encoders code again to see if all the encoders still work?
|
|
#12
|
|||
|
|||
|
Re: Encoder Problem
When I download the frc_encoders the encoders work great but when I add the mecanum drive code only one encoder will feed back values.
|
|
#13
|
|||
|
|||
|
Re: Encoder Problem
Try running the 2 through a diff tool to see the difrences in the 2 files. I didnt see anything when I did a quick look, ill check again when I have more time.
|
|
#14
|
|||
|
|||
|
Re: Encoder Problem
Where would I get a diff tool. I've never even heard of such a thing.
|
|
#15
|
|||
|
|||
|
Re: Encoder Problem
Quote:
From code that works: /* SECOND: Set up the I/O pins you want to use as digital OUTPUTS. */ digital_io_17 = OUTPUT; /* Example - Not used in Default Code. */ /* THIRD: Initialize the values on the digital outputs. */ rc_dig_out17 = 0; From modified code: /* SECOND: Set up the I/O pins you want to use as digital OUTPUTS. */ digital_io_17 = INPUT; /* Example - Not used in Default Code. */ |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Encoder Pinout | bear24rw | Electrical | 4 | 04-12-2006 21:43 |
| Encoder help | Windward | Programming | 21 | 14-01-2006 15:10 |
| Strange Encoder Problem | AIBob | Electrical | 3 | 20-02-2005 22:20 |
| encoder.c | Gary Bonner | Programming | 2 | 14-01-2005 13:41 |