- 博客(5)
- 收藏
- 关注
原创 Python中Tkinter
import tkinter as tk window = tk.Tk() window.title('my window') window.geometry('200x200') var = tk.StringVar() l = tk.Label(window,textvariable=var,bg='green',font=('Arial',12), width=15,height=2) l.pack() on_hit = False def hit_me():
2021-02-21 11:24:51
94
1
原创 STM32学习+电机控制
编码器数据溢出处理 思想:溢出两种形式向前溢出。比如从65535到2,数据溢出了,此时调用del_correct得到(2-65535)+65536=3;另一种形式向后溢出。比如从2到65535数据溢出了,此时调用del_correct得到(65535-2)-65536=-3.而一般情况下电机的位置差值不会超过32768,故-32768-32768是正常区间不用进行处理+0即可。 // An highlighted block ENCx->encAlter = del_correct(ENCx->
2020-12-16 17:52:20
892
1
原创 MATLAB学习记录
Matlab反三角函数命令: asin(),acos(),atan(),acot( ) 生成的值为弧度值,即rad; asind(),acosd(),atand(), acotd( ) 生成的值为角度值; 将弧转换为角度的命令:rad2deg() deg2rad()作用则相反 /…/ sqrt(4) 开根号 ^2 平方 ...
2020-12-16 17:42:43
71
原创 DMA通信+空闲中断
STM32学习笔记——DMA通信 上周学习使用串口通信收发数据,并使用USART1和USART3收发陀螺仪JY901s的数据。经过同学的指导,能够成功接收并处理数据。最后发送出来。这次记录一下学习DMA通信内容。 DMA通信流程 下面展示一些 内联代码片。 #include "usart1.h" #include "stm32f1xx.h" #include <stdio.h> #include <string.h> uint8_t receive_buff[255]={0};
2020-10-23 09:36:22
919
原创 STM32学习笔记——串口通信
STM32学习笔记——串口通信 STM32新手一枚,记录一下学习过程。 采用USART进行通信——其中接收采用接收中断的方式。 //串口一代码 #include "usart1.h" #include "stm32f1xx.h" unsigned char usart1_rev_buf[max_rec_lenth]={0}; unsigned char usart1_temp[rec_lenth]={0}; unsigned int usart1_rx_cnt=0; void HAL_UART_RxC
2020-10-20 18:05:53
141
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人