当前位置:网站首页>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
边栏推荐
- 机器人技术(RoboCup 2D)如何进行一场球赛
- Django celery redis send email asynchronously
- Advanced C language: pointer (1)
- GKObstacle
- Andorid development III (intent)
- GKVoronoiNoiseSource
- GKNoiseMap
- Andorid development
- Semeval 2022 | introducing knowledge into ner system, aridamo academy won the best paper award
- Powerful and unique! Yingzhong technology 2020 10th generation core unique product launch
猜你喜欢

Shortest path topic

Attention 注意力机制流程框图

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

ICML 2022 | graph represents the structure aware transformer model of learning

AP AUTOSAR platform design 3 architecture

GKBillowNoiseSource

Blue Bridge Cup embedded Hal library USART_ TX

GKSpheresNoiseSource

Aike AI frontier promotion (7.28)

AP Autosar平台设计 1-2 导言、技术范围与方法
随机推荐
GKRandom
Using k-means clustering to classify tariff models of different industries
Blue Bridge Cup embedded Hal library USART_ TX
Pyqt5 rapid development and practice 4.11 drag and clipboard
GKSphereObstacle
Andorid development
ICML 2022 | graph represents the structure aware transformer model of learning
GKConstantNoiseSource
Pyqt5 rapid development and practice 4.13 menu bar, toolbar and status bar and 4.14 qprinter
Solving the optimal solution of particle swarm optimization
samba学习
8. Detailed explanation of yarn system architecture and principle
Redis-day01-常识补充及redis介绍
非关系型数据库MongoDB的特点及安装
Yan reported an error: could not find any valid local directory for nmprivate/
Uni app project directory, file function introduction and development specification
GKNoiseSource
GKLinearCongruentialRandomSource
GKARC4RandomSource
GKSphereObstacle