1 Basics SPI has three-wire mode and four-wire mode. The three-wire mode consists of three wires - SS (Slave Select), SCK (SPI Clock), and MOSI (Master-In-Slave-Out). The four wire mode has an extra line called MISO (Master-In-Slave-Out).
Signals Full Name SS Slave Select SCK SPI Clock MOSI Master-Out-Slave-In MISO Master-In-Slave-Out SPI clock has four modes: CPOL=0/1 and CPHA=0/1. CPOL stands for clock polarity – clock low or high when in idle.
Let’s look at a code snippet in the Jupyter Notebook:
1 2 3 4 5 6 7 8 9 10 import time import ipywidgets as widgets from IPython.display import display slider = widgets.IntSlider() display(slider) while True: print(slider.value) time.sleep(1) IntSlider is an interactive Jupyter Notebook widget. When the user interacts with the slider, the slider value should change.
However, if you run the above codes, you will find that the printed value of the slider won’t change at all – it will be stuck at its initial value.
Recently, I have been using Python coroutines/asynchronous programming in a project. Now, I will summarize my experience.
Import 1 import asyncio If asyncio is to be used in an IPython environment, we have to add two more lines:
1 2 3 import nest_asyncio nest_asyncio.apply() import asyncio Coroutines Coroutines are the core of asynchronous programming in Python. To define a coroutine, you need to use async def.
1 2 3 async def main(): # do something print("Hello world!
Windows Set a network adapter that can access the internet in the Control Panel and share it with Ethernet. The IP address of Ethernet will change to 192.168.137.1 (this is the default behavior in Windows).
Then, set the gateway as 192.168.137.1 in the terminal of the development board:
sudo route add default gw 192.168.137.1
Set the IP address as 192.168.137.x, where x is any value except 1 and 255 (gateway address and broadcast address):
Xilinx’s toolchain consumes soooo much memory! Sometimes it causes the system to freeze… After all, my laptop only has 8GB of RAM. So there’s no other choice but to add virtual memories.
After increase the swapfile, the system performance has improved a lot:
1 2 3 4 sudo swapoff /swapfile sudo dd if=/dev/zero of=/swapfile bs=1M count=16384 sudo mkswap /swapfile sudo swapon /swapfile
To partition and format an SD card in Linux, follow these steps: First, connect the SD card to your PC. Then, use the fdisk command in the bash command line to partition the SD card. Finally, use the mkfs command to create a file system (format) on the SD card.
The main commands are as follows:
First, use sudo fdisk -l to confirm which device in /dev corresponds to the SD card.
To mount the EFI partitions, run the following commands in PowerShell:
1 2 3 4 5 6 diskpart list disk # make sure which is the disk that contains the EFI partition. usually 0 select disk 0 list partition # make sure which is the EFI partition. normally 0 select disk 0 assign letter=z Then we will mount the EFI partition as drive Z.
This operation may be useful when using a dual-boot system with Windows and Ubuntu: Sometimes, after removing the Ubuntu system, only the Windows system remains, but the GRUB interface still appears every time the computer boots.
1 Differential Forms Before introducing the concept of curl, we need to first introduce differential forms and the exterior derivative.
An n-form can be defined as an alternating multilinear mapping $\omega:(T_p^*M)^n\rightarrow \mathbb{R}$. It maps multiple vectors to a real number. Additionally, it satisfies the alternating property, meaning that exchanging two input vectors results in an output multiplied by a negative sign.
Therefore, an n-form can be explicitly defined as follows:
1 Introduction In physics textbooks, we often come across the terms “pseudo-vector” and “pseudo-scalar.”
In fact, on a 3-dimensional manifold, a “pseudo-vector” is the exterior product of two tangent vectors, denoted as $v\in T_pM\wedge T_pM=\bigwedge^2(T_pM)$, while a “pseudo-scalar” is the exterior product of three tangent vectors, denoted as $s\in T_pM\wedge T_pM\wedge T_pM=\bigwedge^3(T_pM)$.
When equipped with an inner product (or non-degenerate bilinear form), there exists a Hodge duality between $\bigwedge^2(T_pM)$ and $\bigwedge^1(T_pM)$, which leads us to mistakenly consider the pseudo-vector as a vector.
I recently discovered this fantastic tool for creating personal websites - Hugo. Feels really cool and user-friendly! Plan to gradually migrate my blogs from Zhihu to here in the future.
TBD Chinese version here