# py -3 -m pip install snakeviz
# on Windows:
py -3 -m cProfile -o my_script.profile my_script.py && snakeviz.exe my_script.profile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "mbed.h" | |
| Serial serial(USBTX, USBRX); | |
| DigitalOut led(LED1); | |
| //void onReceive() { | |
| // char c = serial.getc(); | |
| // led = !led; | |
| // serial.putc(c+1); | |
| //} |
- Create "ui" file in Qt Designer or Qt Creator.
- Run update_MainWindow.py which runs
pyuic6 -o my_file.py <file>.uiand moves imports from the bottom to the top of the file, because promoted classes happen to be imported at the bottom for some reason which was causing an error. - See files in this folder (e.g. file_loader.py) to see how to create/connect signals and slots.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| def float_to_concise_str(f): | |
| ''' turns 0.0012345678 into 0.0012 ''' | |
| f = float(f) | |
| if len(str(f).split('.')[1]) < 2 or f >= 1.0: | |
| return str(round(f, 2)) | |
| return np.format_float_positional( float(f'{f:.2}'), trim='-') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ''' | |
| Usage: py -3 copy_bsp.py project_name | |
| This script copies BSP files and Utilities to specified project. | |
| This script should be placed in the workspace folder of STM32CubeIDE. | |
| In the same directory where project folders are created. | |
| REPOSITORY_PATH must be manually modified in this script in order to work. | |
| Whenever "Project -> Generate Code" option is used, the Utilities folder |
OlderNewer