当前位置:网站首页>Bluebridge cup internet of things basic graphic tutorial - GPIO output control LD5 on and off
Bluebridge cup internet of things basic graphic tutorial - GPIO output control LD5 on and off
2022-07-05 08:16:00 【IOT Xiaokai】
Blue Bridge Cup Internet of things basic tutorial ——GPIO Output control LD5 Light out
( This series of tutorials is for some people who have stm32 Basic students , Those who need to participate in the Blue Bridge Cup Internet of things competition , Yes HAL Library interested students to provide reference , This article will not go into detail about stm32 Basic principle guidance )
Preparation :
install keil5、STM32CubeMX And so on , Configure accordingly pack.
Refer to other tutorials on the network for details , This article will not be repeated .
1、 open STM32CubeMX New project 

2、 Choose the chip model according to your chip type ( Here is STM32L071KBUx)
3、 Choose the clock
Since there is no need to consider accuracy ( After that, we need to consider the detailed setting of crystal oscillator ), Directly set 24M Crystal oscillator ( Any size , You can also enter 32M)
4、 Set up GPIO The output mode (PC15 control LD5 Light out , to PC15 names LD5)

5、 Available in the left column GPIO Observe the area you set GPIO Detailed settings


6、 Generate project files




7、 Set up keil5, For editing 、 Download the code to prepare




8、 Open file , Edit your own code , control LD5 Light out ( Be careful CubeMX Mainly the initial function , In order to reduce the programmer's initialization operation , The logic part of the code still needs to be edited by programmers )

Code :
HAL_GPIO_WritePin(LD5_GPIO_Port,LD5_Pin,0); //PC15 Low level ,LD5 bright
HAL_Delay(1000); // Delay 1s
HAL_GPIO_WritePin(LD5_GPIO_Port,LD5_Pin,1);//PC15 High level ,LD5 destroy
HAL_Delay(1000);
Observe the development board phenomenon
LD5 every other 1s Light up once
边栏推荐
- C WinForm [get file path -- traverse folder pictures] - practical exercise 6
- STM32 --- serial port communication
- Talk about the circuit use of TVs tube
- C WinForm [display real-time time in the status bar] - practical exercise 1
- Programming knowledge -- assembly knowledge
- Live555 push RTSP audio and video stream summary (III) flower screen problem caused by pushing H264 real-time stream
- Anonymous structure in C language
- Installation and use of libjpeg and ligpng
- STM32 tutorial triple ADC interleaved sampling
- Solutions to compilation warnings in Quartus II
猜你喜欢

实例006:斐波那契数列

Network communication model -- Network OSI tcp/ip layering

Several implementation schemes of anti reverse connection protection of positive and negative poles of power supply!

Installation and use of libjpeg and ligpng

C, Numerical Recipes in C, solution of linear algebraic equations, LU decomposition source program

Hardware and software solution of FPGA key chattering elimination
![Measurement fitting based on Halcon learning [i] fuse Hdev routine](/img/91/34c92065e797c87d6ce5ea13903993.jpg)
Measurement fitting based on Halcon learning [i] fuse Hdev routine
![[cloud native | learn kubernetes from scratch] III. kubernetes cluster management tool kubectl](/img/8a/702019b44c8e60dffbcd898330afcb.png)
[cloud native | learn kubernetes from scratch] III. kubernetes cluster management tool kubectl

Design a clock frequency division circuit that can be switched arbitrarily

Management and use of DokuWiki
随机推荐
MHA High available Cluster for MySQL
Imx6ull bare metal development learning 2- use C language to light LED indicator
[trio basic tutorial 18 from introduction to proficiency] trio motion controller UDP fast exchange data communication
Sql Server的存储过程详解
Sql Server的存儲過程詳解
Hardware and software solution of FPGA key chattering elimination
Let's briefly talk about the chips commonly used in mobile phones - OVP chips
Introduction of air gap, etc
Stablq of linked list
Verilog -- state machine coding method
How to copy formatted notepad++ text?
Array integration initialization (C language)
Explication de la procédure stockée pour SQL Server
Semiconductor devices (I) PN junction
STM32 single chip microcomputer -- volatile keyword
Shell script realizes the reading of serial port and the parsing of message
Various types of questions judged by prime numbers within 100 (C language)
Development tools -- gcc compiler usage
How to select conductive slip ring
Problem solving: interpreter error: no file or directory