|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Re: Encoder Problem.
I am pretty sure the encoder works cause it works fine on a arduino
|
|
#2
|
||||
|
||||
|
Re: Encoder Problem.
Quote:
And as long as you're doing that, use the voltmeter to check that channels A and B are cycling. |
|
#3
|
||||
|
||||
|
Re: Encoder Problem.
Try changing "TestEnc" to "testEnc". You're not supposed to capitalize variable names.
If that doesn't work:
|
|
#4
|
|||||
|
|||||
|
Re: Encoder Problem.
Quote:
I personally am a fan of capitalizing the first letter of a variable name to indicate it is a variable, and naming all macros in all capitals with underscores separating words to differentiate them. I've also seen incredibly structured variable naming methods that define everything about a variable in the name. For example, using three to six letter module name prefixes, and coding the type or units in (e.g. p for pressure, or kpa for kilopascals), or type of variable (e.g. m for map, c for calibration, etc.) and these work as well. It's really all personal preference, as long as you are consistent the compiler really doesn't care at all. |
|
#5
|
|||||
|
|||||
|
Re: Encoder Problem.
Agreed that capitalization won't change anything. Rearranging deck chairs on the Titanic, that is. I think the C++ convention of variables starting with lower case letters is to distinguish them from classes and functions with start with uppercase letters. Though this may be Java, which has the opposite standard, I think.
I think your reset and start calls need to be in the other order. I'd also suggest putting an extra println in your loop just to make sure you're actually getting into the loop and all that. Possibly with an increment just for kicks. I'd also recommend checking the outputs with a multimeter just to make sure that's not the problem. We have a different encoder board that's been fried and isn't good anymore. The only way you can tell is the output is constantly at 0.7V, never 0V or 5V as it should be. It's super easy to accidentally fry an output with static, so don't assume that it's still working fine just because it used to. Trust, but verify. |
|
#6
|
||||
|
||||
|
Re: Encoder Problem.
Quote:
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|