XpandNotes

exploring the intersection of technology and creativity

在 stm32f407g 使用 uart

環境: wnidows 10, STM32CubeIDE 1.8.0 在這個教學將透過 PA0 和 PA1 腳位來使用 uart4。 專案初始化 首先在 CubeIDE 新增 stm32f407g 的專案,將專案命名為 uart_test。 設定 RCC 中的 High Speed Clock 與 Low Speed Cock。 設定 SYS 的 Debug 與 Timeb...

Leetcode #70 Climbing Stairs

Description You are climbing a staircase. It takes n steps to reach the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top? Example 1: Input: n...

Leetcode #21 Merge Two Sorted Lists

Description You are given the heads of two sorted linked lists list1 and list2. Merge the two lists in a one sorted list. The list should be made by splicing together the nodes of the first two l...

Leetcode #206 Reverse Linked List

Description Given the head of a singly linked list, reverse the list, and return the reversed list. Example 1: Input: head = [1,2,3,4,5] Output: [5,4,3,2,1] Constraints: The number of nodes...

Leetcode #20 Valid Parentheses

Description Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. An input string is valid if: Open brackets must be closed ...

Leetcode #102 Binary Tree Level Order Traversal

Description Given the root of a binary tree, return the level order traversal of its nodes’ values. (i.e., from left to right, level by level). Example 1: Input: root = [3,9,20,null,null,15,7]...

Graph Theory Homework 1

1. Prove or disprove: 9, 6, 5, 5, 3, 3, 2, 1, 1 are the vertex degrees of some graph. Each edge contributes one degree to each of its two endpoints, therefore $\Sigma_{v \in V(G)}d(v)=2e(G)$, whic...

OpenCV 圖片混合

OpenCV 圖片混合的函式為: 1 cv2.addWeighted(src1, alpha, src2, beta, gamma, dst=..., dtype=...) -> dst 必要參數 src1: 第一張圖片的 numpy array。 alpha: 第一張圖片的權重。 src2: 第二張圖片的 numpy array。 beta: 第二張圖片的權...

OpenCV 讀檔、寫檔、分離 RGB 通道

安裝 opencv-python $ pip install opencv-python OpenCV 讀檔 將圖片命名為 image.jpg 並放在與下方 python 檔案同一個目錄下。 1 2 3 4 5 # showimg.py import cv2 img = cv2.imread("image.jpg") cv2.imshow("Image", img) cv2.wai...

論文翻譯 A Dynamic Priority Assignment Technique for Streams with (m, k)-Firm Deadlines

摘要 本文將會解決 scheduling multiple streams of real-time customers。首先介紹 (m, k)-firm deadlines 的概念以表達對 real-time stream 計時的限制:任何 k 個連續 customer 中至少有 m 個必須滿足他們的 deadline,則稱此 stream 擁有 (m, k)-firm deadline...