User interface script for data collection and reception from Nucleo. More...
Functions | |
def | userInterfaceW1.gCallback (key) |
Callback function for the 'g' key release. More... | |
def | userInterfaceW1.sCallback (key) |
Callback function for the 's' key press. More... | |
Variables | |
userInterfaceW1.last_key = None | |
Keeping track of last key actuated. | |
int | userInterfaceW1.n = 0 |
Counting variable. | |
list | userInterfaceW1.dataSet = [] |
Housing for data before it is cleaned. | |
userInterfaceW1.times = array('f', []) | |
Time data that is read in through serial. | |
userInterfaceW1.values = array('f', []) | |
Data values that are read in through serial. | |
userInterfaceW1.ser = serial.Serial(port='COM9',baudrate=115273,timeout=.25) | |
Serial object to communicate through VCP port. | |
userInterfaceW1.sCallback | |
userInterfaceW1.gCallback | |
userInterfaceW1.value = ser.readline().decode() | |
Individual line read from Nucleo containing a variety of different things that must be sorted. | |
userInterfaceW1.newline | |
Assists in writing new lines into .csv. | |
userInterfaceW1.writer = csv.writer(csvfile) | |
CSV writer object that can use .writerow to write into my CSV file. | |
User interface script for data collection and reception from Nucleo.
This is the main script the user will use while simultaneously running data collection file on the Nucleo. This script will read the data that the Nucleo sends us, clean it up, plot time vs. value, then write all the data to empty dataCollection.csv or user can easily change to write to their desired file.
Source code files and related ones:
mainW1.py https://bitbucket.org/ColeSheedy/me-305-work-repository/src/master/LabWork/Lab4/mainW1.py
dataHandlingClassW1.py https://bitbucket.org/ColeSheedy/me-305-work-repository/src/master/LabWork/Lab4/dataHandlingClassW1.py
userInterfaceW1.py https://bitbucket.org/ColeSheedy/me-305-work-repository/src/master/LabWork/Lab4/userInterfaceW1.py
def userInterfaceW1.gCallback | ( | key | ) |
Callback function for the 'g' key release.
If user presses the 'g' key down, the keyboard function will be enabled. We will use this callback function to send the letter 'g' to the Nucleo to start data collection when the user decides to.
def userInterfaceW1.sCallback | ( | key | ) |
Callback function for the 's' key press.
If user presses the 's' key down, the keyboard function will be enabled. We will use this callback function to send the letter 's' to the Nucleo to start data collection when the user decides to.