ME 405 Term Project: Thermal Imaging Nerf Turret 1.0
A library that contains software used to control and fire an automated Nerf turret. The turret uses a MLX90640 Thermal Imaging camera to determine opponent's position and fire.
src.Encoder.Encoder Class Reference

This class contains functionality to setup, read, and zero a quadrature encoder on a 16 bit timer channel on an STM-32. More...

Public Member Functions

 __init__ (self, ENA, ENB, timer, CHA, CHB)
 Creates an Encoder object that intializes the Encoder's pins and sets the set GPIO Pin Timer and respective channels.
 
 read (self)
 Function reads the Encoder's position as a positive/negative integer.
 
 zero (self)
 Function set all Encoder counts to 0.
 

Public Attributes

 pinENA
 
 pinENB
 
 tim
 
 ENCA
 
 ENCB
 
 lastCount
 
 totalCount
 

Detailed Description

This class contains functionality to setup, read, and zero a quadrature encoder on a 16 bit timer channel on an STM-32.

Constructor & Destructor Documentation

◆ __init__()

src.Encoder.Encoder.__init__ ( self,
ENA,
ENB,
timer,
CHA,
CHB )

Creates an Encoder object that intializes the Encoder's pins and sets the set GPIO Pin Timer and respective channels.

Parameters
ENAGPIO pin associated with Encoder Channel A.
ENBGPIO pin associated with Encoder Channel B.
timerTimer object used as a counter.
CHATimer Channel corresponding to Encoder Channel A.
CHBTimer Channel corresponding to Encoder Channel B.

Member Function Documentation

◆ read()

src.Encoder.Encoder.read ( self)

Function reads the Encoder's position as a positive/negative integer.

Accounts for under- and over-flow cases by comparing the most recent and current count from the Encoder.

Returns
Total encoder count as an integer

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