My Project
UI_front1.py File Reference

Collects data from Nucleo to computer. More...

Functions

def UI_front1.key_callback (key)
 callback function called when keyboard key has been pressed More...
 
def UI_front1.getData ()
 Initiates UI_data to start collecting data to send back to UI_front. More...
 

Variables

 UI_front1.ser = serial.Serial(port='COM3',baudrate=115200,timeout=1)
 connect to serial port
 
int UI_front1.state = 0
 Set state equal to 0.
 
 UI_front1.time = array('f', 3001*[])
 Time array that hold data for 30 secs to plot.
 
 UI_front1.value = array('f', 3001*[])
 Data array.
 
 UI_front1.callback
 
 UI_front1.key_callback
 
 UI_front1.suppress
 
 UI_front1.last_key = None
 turns off keyboard callback
 
 UI_front1.fileData = open('UIdata.txt', "w+")
 file name to save the data fileName = input("Type the .txt filename you would like to save the data on (ex: UI_data.txt): ") More...
 
def UI_front1.stringList = getData()
 read values from UART and load into string
 
def UI_front1.stripList = stringList.strip()
 Strip String.
 
def UI_front1.splitList = stripList.split(',')
 split the stripped string
 
 UI_front1.num1
 stores numbers, num 1 is time and num 2 is value
 
 UI_front1.num2
 

Detailed Description

Collects data from Nucleo to computer.

Implements a system to open and run python file in Spyder that acts as the UI front end. In the Spyder console, Pressing 'G' key will begin data collection and 'S' key will terminate data collection. The data collected is stored in a local array on local and transmitted as a batch to the laptop and saved within a .CSV. Plots the data in the PC using the matplotlib module. The link to the code can be found here: https://bitbucket.org/mzaman01/me305_labs/src/master/LabFF/UI_front.py

Example When 30 Seconds of Data is Collected
Example When Less Than 30 Seconds of Data is Collected
Author
Maisha Zaman
Date
February 25th, 2021

Function Documentation

◆ getData()

def UI_front1.getData ( )

Initiates UI_data to start collecting data to send back to UI_front.

Sends 'G' to the UI_data class to start running through the data. The data sent back is transferred into a string to be processed. Timeout is created if nothing is returned.

Returns
Nucleo data in string form

◆ key_callback()

def UI_front1.key_callback (   key)

callback function called when keyboard key has been pressed

Parameters
keyinput to trigger or turn off callback

Variable Documentation

◆ fileData

UI_front1.fileData = open('UIdata.txt', "w+")

file name to save the data fileName = input("Type the .txt filename you would like to save the data on (ex: UI_data.txt): ")

Create file base to save .CSV data