当前位置:网站首页>Stm32f103c8t6 firmware library lighting
Stm32f103c8t6 firmware library lighting
2022-07-03 16:01:00 【Big golden hair】
summary : Configure lighting graphic description through firmware library
1. In the firmware library folder USER Create a folder in LED, stay LED Create text in folder ,LED.C,LED.H


2. stay keil Middle double click user The folder will c Add the file

3. stay c Add the required header file to the file , This time we need
#include "led.h"
#include "stm32f10x.h"Compile once after adding
4. open led.h, Add... To it
#include "stm32f10x.h"5. Add a path to the magic wand



7. Write led-init Function configuration GPIO Structure

It can be seen from the schematic diagram that LED Corresponding PC13, We need to configure GPIOc The clock of ,GPIOc Mounted on APB2 On , So it needs to be turned on APB2 The clock on the computer .

GPIO_InitTypeDef It includes

Pin , Speed ( You can choose any one for the time being ), The output mode ( Push pull output )
Use GPIO_Init(); Function initialization on GPIO, The first parameter is GPIOX, The second is the address of the structure variable
stay h Relevant functions are described in the document

8. stay main.c Initialization function used in

9. You need to use two functions ,GPIO_SetBit()[ Set up 1] and GPIO_RsetBit()[ Set up 0]
From the schematic diagram, you want LED bright GPIO One end should be placed 0 In order to have enough pressure difference to make LED bright
GPIO_ResetBits(GPIOC,GPIO_Pin_13);10. compile , Swipe after no error
边栏推荐
- Go语言自学系列 | golang中的if else语句
- Redis high availability and persistence
- 秒杀系统3-商品列表和商品详情
- [combinatorics] combinatorial identities (sum of variable terms 3 combinatorial identities | sum of variable terms 4 combinatorial identities | binomial theorem + derivation to prove combinatorial ide
- 使用AUR下载并安装常用程序
- Driver and application communication
- App移动端测试【4】apk的操纵
- Microservice - Nacos registration center and configuration center
- Reflection on some things
- Embedded development: seven reasons to avoid open source software
猜你喜欢

突破100万,剑指200万!

Seckill system 3- product list and product details

Microservices Seata distributed transactions

VS2017通过IP调试驱动(双机调试)

Digital image processing -- popular understanding of corrosion and expansion

《微服务设计》读书笔记(下)

Break through 1million, sword finger 2million!

nifi从入门到实战(保姆级教程)——flow

Mongodb installation and basic operation

Microservice API gateway zuul
随机推荐
Unity function - unity offline document download and use
MB10M-ASEMI整流桥MB10M
How are integer and floating-point types stored in memory
Break through 1million, sword finger 2million!
Seckill system 3- product list and product details
秒殺系統3-商品列錶和商品詳情
通过进程PID获取可执行文件路径(QueryFullProcessImageName)
Custom annotation
From "zero sum game" to "positive sum game", PAAS triggered the third wave of cloud computing
Batch files: list all files in a directory with relative paths - batch files: list all files in a directory with relative paths
初试scikit-learn库
Creation and destruction of function stack frames
How to use AAB to APK and APK to AAB of Google play apps on the shelves
C language brush questions ~leetcode and simple questions of niuke.com
Get the executable path through the process PID (queryfullprocessimagename)
Go language self-study series | if else statement in golang
Redis高可用与持久化
Popular understanding of ovo and ovr
Brush questions -- sword finger offer
Distributed task scheduling XXL job