![]() |
Re: Misbehaving encoders
Quote:
Everything looks correct to me. So the problem is either really obscure, or right under our noses. More ideas: 1. Are you sure you are using the correct port on the cRIO for the sidecar? Are you sure the sidecar is fully powered (12V power from the main breaker is necessary)? 2. Try commenting out the encoder code and instead creating DigitalInputs on the same two DIO lines. Call Get() on that and turn the encoder to make sure that you can at least see the two lines fluctuating. 3. Since you have a multimeter, verify that you are getting (close to) 0V and 5V on the Ch A and Ch B outputs as you rotate the powered encoder. |
Re: Misbehaving encoders
Quote:
Sounds right. Are you doing this in Autonomous mode? We couldn't read our sensors in autonomous. They act like they never change. I wasn't involved with the software but The sensors worked in teleop mode so we proved they were working. Not sure what the problem was. They may not have been set up as global variables ... something like that. Steve |
Re: Misbehaving encoders
Quote:
|
Re: Misbehaving encoders
Quote:
And yeah, we're running it in the teleop mode,and we have other sensors on the GPIO that work fine |
Re: Misbehaving encoders
Quote:
An actual photograph of your wiring would help a lot at this point. So would a good closeup of how you have the encoder disk attached. Your code looks fine to me (except for a nagging worry about using the %d format specifier with a long integer). |
Re: Misbehaving encoders
Just as a wild spitball...in your program, do you have to do anything to enable the interrupt for the encoders ?
Steve |
Re: Misbehaving encoders
Code:
encoder1->Start();And with the long-int %d--even if this was printing incorrectly, the encoder stopped flag should be changing, right? |
Re: Misbehaving encoders
Quote:
Code:
printf("encoder1=%d", (int)(encoder1->Get())); |
Re: Misbehaving encoders
Quote:
|
| All times are GMT -5. The time now is 07:33. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi