|
nerf-turret 1
Infrared targeting nerf turret
|
This class implements an encoder reader for an ME 405 kit. More...
Public Member Functions | |
| def | __init__ (self, str pin1, str pin2, int timer, int ch1, int ch2) |
| Creates an encoder reader and configures the appropriate pins, timers, and timer channels. | |
| def | zero (self) |
| Sets the current position of the encoder to zero (does not modify the timer count). | |
| def | read (self) |
| Reads the current position of the encoder. | |
This class implements an encoder reader for an ME 405 kit.
| def encoder_reader.EncoderReader.__init__ | ( | self, | |
| str | pin1, | ||
| str | pin2, | ||
| int | timer, | ||
| int | ch1, | ||
| int | ch2 | ||
| ) |
Creates an encoder reader and configures the appropriate pins, timers, and timer channels.
| pin1 | String containing the pin label for the first encoder channel (e.g. 'A10' for pin A10) |
| pin2 | String containing the pin label for the second encoder channel |
| timer | Number of the timer to configure, given as integer (e.g. 5 for TIM5) |
| ch1 | The channel number of the first encoder channel, given as integer (e.g. 1 for TIMx CH1) |
| ch2 | The channel number of the second encoder channel, given as integer |
| def encoder_reader.EncoderReader.read | ( | self | ) |
Reads the current position of the encoder.