ME 305 Website by Cole Sheedy
UITaskW2.UITask Class Reference

Runs the UI backend for the encoder reading and UI file. More...

Public Member Functions

def __init__ (self, collectionDuration=30, frequency=10)
 Constructor of UITask. More...
 
def run (self)
 Runs the finite state machine of the UITask. More...
 

Public Attributes

 times
 Array object for the times that will be appended.
 
 collectionDuration
 Total number of data points to be collected if uninterrupted.
 
 n
 Counting variable.
 
 state
 State tracking variable.
 
 iteration
 Iteration variable for prompting.
 
 values
 Data points collected from encoder position.
 

Static Public Attributes

 myuart = UART(2)
 UART port object.
 

Detailed Description

Runs the UI backend for the encoder reading and UI file.

Constructor & Destructor Documentation

◆ __init__()

def UITaskW2.UITask.__init__ (   self,
  collectionDuration = 30,
  frequency = 10 
)

Constructor of UITask.

This construction takes two attributes called collectionDuration and frequency. collectionDuration is the amount of time in seconds the user wishes to collect data. The frequency is slightly different than a normal frequency. This is not related to the frequency at which the UITask runs, however, it is the frequency at which the encoderTask runs. It is important to keep these the same as is creates a related time data array for how long the and how fast the encoder is running.

Parameters
collectionDurationTime for which the task runs.
frequencyFrequency at which the encoder is collecting data in the encoderTask. They must match.

Member Function Documentation

◆ run()

def UITaskW2.UITask.run (   self)

Runs the finite state machine of the UITask.

This finite state machine has approximately 3 state. The first state waits for a 'g' keystroke from the user to start data collection. The second state waits for other commands from the user like 'p', 's', 'd', and 'z'. Once done collecting data, the third state send the data collected, which is waiting in a queue in share.py, via the UART port to the front end.


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