- Create "ui" file in Qt Designer or Qt Creator.
- Run update_MainWindow.py which runs
pyuic6 -o my_file.py <file>.ui
and 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 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 |
This file contains 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='-') |
# 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 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); | |
//} |
This file contains 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 pc(USBTX, USBRX); // tx, rx | |
BusOut cols_out(p26, p25, p24); | |
// Checking extension board with multimeter shows that p14,p13,p12,p11 are connected | |
// to row indicating pins of the keypad. The extension board schematic is incorrect. | |
BusIn rows_in(p14, p13, p12, p11); |
This file contains 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" | |
// mosi, miso (unused really), sclk | |
SPI sw(p5, p6, p7); | |
// lat (latch) pin of TLC59281 as shown in extension board schematic | |
DigitalOut lat(p8); | |
/* The extension board wiring from TLC59281 to 3 LEDs pairs are not consistent with | |
remaining 5 LEDs pairs (green is wired as red, red is wired as green). |
This file contains 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
#!/usr/bin/python3 | |
''' | |
This script can be replaced by simply using: | |
python3 -m serial.tools.list_ports -v | |
''' | |
import serial # pip install pyserial | |
import serial.tools.list_ports as list_ports |
This file contains 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
''' Example usage with dma.sendchannel supplying the data: | |
import os, subprocess, sys, re, time | |
from pathlib import Path | |
from pynq import Overlay | |
from pynq import allocate | |
from threading import Thread | |
from dma_receiver import DmaReceiver |
This file contains 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
#!py -3 | |
''' | |
After using Vivado block design, creating a HDL wrapper for it, | |
and generating bitstream, this script can be used to move the | |
"_wrapper.bit" and ".hwh" files to pynq. | |
Tested on Windows only. | |
''' | |
import shutil |
NewerOlder