PSoC6 Data Collection to CSV log file
Last updated
Last updated
1.1 Create Project through ModusToolbox
1.2 Steps to Configure the Code:
Navigate to the gesture.h
File:
Locate the gesture.h
file within the source
folder of the project directory.
Modify the Macro for Data Collection Mode:
Open the gesture.h
file.
Find the line defining GESTURE_DATA_COLLECTION_MODE
.
Change its value from 0u
to 1u
.
This change enables printing sensor data to the terminal instead of running the inference engine.
Navigate to the Makefile
:
Locate the Makefile
in the root directory of the project.
Update the Shield:
Open the Makefile
.
Look for the shield configuration line:
Change this to:
This updates the configuration to use the CY_028_SENSE_SHIELD_v2
for gathering IMU data.
1.3 Build and Launch the application
1.4 Let's collect dataset by Eclipse
Open modus-shell
Navigate to the folder and install the library.
To collect data from the sensor, use the command line as below:
ตัวอย่าง:
After data collection, the dataset is stored in the Machine_Learning_Gesture_Classification\train\gesture_data\<your gesture name> directory as a .txt file
2.1 Plot graph
Create project in google colab: https://colab.research.google.com/drive/1zkqpE8NGNUJv6uIUV-4ItKIbkxr1n4qj?usp=sharing
Install library
Using below code for plot the graph for each sensor dataset:
Sample Graph Outputs from the Dataset
2.2 Covert to .csv file
Colab: https://colab.research.google.com/drive/1wdsgtEFlWhmXoo3XLQOzVhtO8u_F96Nt?usp=sharing
Open Colab and create your own copy before running the code:
This session in Colab is used to convert a .txt
dataset to a .csv
dataset.