当前位置:网站首页>Blue Bridge Cup embedded Hal library systick
Blue Bridge Cup embedded Hal library systick
2022-07-28 10:49:00 【[email protected]】
List of articles
The experiment purpose
Through the tick timer to achieve one-way flow lamp effect
Hardware design
PC8~PC15 Corresponding G4 On board LED Of a lamp LD1~LD8
PD2 Connect latch
explain : According to the schematic diagram ,LED Light in Low level when bright , High level when destroy
The enable end of the latch is connected with PD2 Connected to a , Latch data at low level ( The latch output does not vary with the input ), Data is not latched at high power ( The latch output varies with the input )

unsigned char
1、unsigned char Is an unsigned byte type ,char The size of type variables is usually 1 Bytes (1 byte =8 bits ), And it belongs to integer .
2、 stay 32 One of the bit systems char The type is generally 8 individual bit, Therefore, the range of data that can be stored is -128~127, and unsigned char It is 0~255, The data stored in character type is used to represent characters , for example ASCⅡ or Unicode.
link :unsigned char
unsigned char summary
unsigned char The range that can be expressed is 0~255, therefore unsigned char ms_led =1000 Out of range , There will be a warning .
processing method
Defined as unsigned int ms_led =1000
remaining problems
1、 How to make the direction of the water lamp from LD8 To LD1??
2、ms_led=0;// Why does removing this sentence also have the effect of running water lamp , But the time of running water lamp slows down ?
Summary of the experiment
adopt SYSTICK Interrupt the service function to realize the running light effect ,1ms Enter an interrupt service function .
The key code to realize the water lamp :GPIOC->ODR=~(0x0001 << ++i).
Variable i Auxiliary shift , Variable ms_led Auxiliary delay .
PD2 Used to latch data .
版权声明
本文为[[email protected]]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/209/202207281025239369.html
边栏推荐
- SQL Server 2016 learning record - nested query
- Semeval 2022 | introducing knowledge into ner system, aridamo academy won the best paper award
- 产品端数据分析思维
- GKBillowNoiseSource
- GKCheckerboardNoiseSource
- GKConstantNoiseSource
- GKRidgedNoiseSource
- GKSpheresNoiseSource
- Inverse element & combinatorial number & fast power
- OCR knowledge summary
猜你喜欢
Advanced C language: pointer (1)

产品端数据分析思维
c语言进阶篇:指针(一)

粒子群实现最优解的求解

7. MapReduce custom sorting implementation

GKSpheresNoiseSource

Two years of crud, two graduates, two months of preparation for the interview with ALI, and fortunately won the offer grading p6

Batch Normlization

非关系型数据库MongoDB的特点及安装

10_ue4进阶_添加倒地和施法动作
随机推荐
机器人技术(RoboCup 2D)如何进行一场球赛
GKObstacle
How to play a ball game with RoboCup 2D
蓝桥杯嵌入式-HAL库-USART_TX
andorid 开发
ICML 2022 | 图表示学习的结构感知Transformer模型
PyQt5快速开发与实战 4.13 菜单栏、工具栏与状态栏 and 4.14 QPrinter
GKCoherentNoiseSource
Codeforces Round #614 (Div. 2) B. JOE is on TV!
8. Detailed explanation of yarn system architecture and principle
GKSpheresNoiseSource
Andorid 开发三 (Intent)
Qt生成.exe文件 并 在无Qt环境下运行(Enigma Virtual Box进行绿色可执行软件封装)图文教程
AP AUTOSAR platform design 3 architecture
GKLinearCongruentialRandomSource
Andorid development
非关系型数据库MongoDB的特点及安装
Batch Normlization
乱打日志的男孩运气怎么样我不知道,加班肯定很多
Machine learning -- handwritten English alphabet 2 -- importing and processing data