Pen Plotter Project
encoder_clephan_mcgrath.Encoder Class Reference

This class implements an encoder for an ME405 kit. More...

Public Member Functions

def __init__ (self, Pinch1, Pinch2, timerNum)
 Constructs an encoder object. More...
 
def update (self)
 Updates encoder position and delta.
 
def read (self)
 Returns encoder position. More...
 
def zero (self)
 Sets encoder position to zero.
 
def get_delta (self)
 Returns encoder delta. More...
 

Public Attributes

 timX
 Configures Nucleo timer at some parameter timerNum, and.
 
 position
 Configures relationship between timer and encoder B pin. More...
 
 Eposition
 Encoder position, which doesn't account for overflow.
 

Detailed Description

This class implements an encoder for an ME405 kit.

Constructor & Destructor Documentation

◆ __init__()

def encoder_clephan_mcgrath.Encoder.__init__ (   self,
  Pinch1,
  Pinch2,
  timerNum 
)

Constructs an encoder object.

Instantiates timer, timer channels for encoder, and actual/encoderr position

Parameters
Pinch1is the encoder channel B
Pinch2is the encoder channel A
timerNumis timer number used as found on Nucleo datasheet

Member Function Documentation

◆ get_delta()

def encoder_clephan_mcgrath.Encoder.get_delta (   self)

Returns encoder delta.

Returns
The change in position of the encoder shaft between the two most recent updates

◆ read()

def encoder_clephan_mcgrath.Encoder.read (   self)

Returns encoder position.

Returns
The position of the encoder shaft

Member Data Documentation

◆ position

encoder_clephan_mcgrath.Encoder.position

Configures relationship between timer and encoder B pin.

Configures relationship between timer and encoder A pin

Actual position as recorded by the encoder


The documentation for this class was generated from the following file: