View Single Post
  #13   Spotlight this post!  
Unread 03-03-2013, 11:36
slijin's Avatar
slijin slijin is offline
Pockets
AKA: Samuel Lijin
FRC #0694 (StuyPulse)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2010
Location: New York City
Posts: 537
slijin is a splendid one to beholdslijin is a splendid one to beholdslijin is a splendid one to beholdslijin is a splendid one to beholdslijin is a splendid one to beholdslijin is a splendid one to beholdslijin is a splendid one to behold
Re: Encoder Problem.

Quote:
Originally Posted by apalrd View Post
I don't see any reason it wouldn't work if you capitalize variable names. In fact, I highly recommend using some sort of mixed case or underscores to separate words in variables for readability.

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.
Quote:
Originally Posted by Kevin Sevcik View Post
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've ran into weird errors with Java when the leading character isn't a lowercase letter, hence my suggestion.

Quote:
Originally Posted by Kevin Sevcik View Post
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 don't believe there's any problem with the order of the reset() and start() calls, as start() initializes the accumulator, and reset() just resets the count to 0 - one does not affect the other.

Quote:
Originally Posted by Kevin Sevcik View Post
I'd also recommend checking the outputs with a multimeter just to make sure that's not the problem... 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.
He did say that the encoder worked fine on an Arduino.
__________________

2010-12 CT Chairman's
2011 Galileo 5th seed
2010 NY Regional Winners