Publishing for Michael McKinley to calibrate.
Fork of Encoders by
Diff: Encoder.h
- Revision:
- 1:2e39be3d2088
- Parent:
- 0:1d2644a20b71
--- a/Encoder.h Mon Nov 24 03:33:29 2014 +0000 +++ b/Encoder.h Sat Mar 07 01:56:09 2015 +0000 @@ -18,19 +18,48 @@ short int readRaw(); // Functions private: + /** + * SPI bus for communicating with the encoder. + **/ SPI _spi; + /** + * SPI chip select pin for communicating with the encoder. + **/ DigitalOut _cs; + /** + *Calculates the parity of the input. + *@params x The message that you want to calculate the parity of. + *@returns A boolean variable that represents the parity of the message. + **/ bool parity_calc(int x); + /** + *Sign variable used to flip the direction of the encoder if needed. + **/ int sign; + /** + *Reads the encoder, does parity check, and stores the error flag. + *@returns An unsigned integer which is the number of ticks away from the zero position. + **/ int read(); + /** + *The parity comparison of the previous transmission + **/ bool parity; + /** + *The encoder flag of the previous transmission + **/ bool enc_flag; - //zero_ang for standing position + /** + *Zero angle set point for standing position. + **/ float zero_ang; + /** + *The raw angle from the encoder in encoder ticks. + **/ short int raw; - - - // Variables + /** + *Used for translating from encoder ticks to degrees. + **/ const float enc2deg; };