当前位置:网站首页>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
边栏推荐
- Google sitemap files for rails Projects - Google sitemap files for rails projects
- C, Numerical Recipes in C, solution of linear algebraic equations, LU decomposition source program
- Brief discussion on Buck buck circuit
- Nb-iot technical summary
- Classic application of MOS transistor circuit design (2) - switch circuit design
- Sizeof (function name) =?
- DCDC circuit - function of bootstrap capacitor
- Solutions to compilation warnings in Quartus II
- Shell script realizes the reading of serial port and the parsing of message
- C language # and #
猜你喜欢
![[tutorial 15 of trio basic from introduction to proficiency] trio free serial communication](/img/08/7f28008a4aa999650998ba8dee5d8e.jpg)
[tutorial 15 of trio basic from introduction to proficiency] trio free serial communication
![Halcon's practice based on shape template matching [1]](/img/68/206eed7502fbf108a929aa9365b1ae.jpg)
Halcon's practice based on shape template matching [1]

Wifi-802.11 negotiation rate table

Summary of SIM card circuit knowledge
![[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

Semiconductor devices (I) PN junction
![C WinForm [exit application] - practice 3](/img/25/30c795cc3fa6931eb1d733719d4ad0.jpg)
C WinForm [exit application] - practice 3

Tailq of linked list

STM32 tutorial triple ADC interleaved sampling
![[trio basic tutorial 17 from getting started to mastering] set up and connect the trio motion controller and input the activation code](/img/58/576b6b77509ed7a9bef138f3899e37.jpg)
[trio basic tutorial 17 from getting started to mastering] set up and connect the trio motion controller and input the activation code
随机推荐
[tutorial 15 of trio basic from introduction to proficiency] trio free serial communication
C # joint configuration with Halcon
Classic application of MOS transistor circuit design (2) - switch circuit design
Volatile of C language
OC and OD gate circuit
[trio basic tutorial 16 from introduction to proficiency] UDP communication test supplement
Weidongshan Internet of things learning lesson 1
More than 90% of hardware engineers will encounter problems when MOS tubes are burned out!
C WinForm [help interface - send email] - practice five
Shape template matching based on Halcon learning [vi] find_ mirror_ dies. Hdev routine
The firmware of the connected j-link does not support the following memory access
Some thoughts on extracting perspectives from ealfa and Ebeta
Working principle and type selection of common mode inductor
C language enhancement -- pointer
Process communication mode between different hosts -- socket
Fundamentals of C language
What are the test items of power battery ul2580
[tutorial 19 of trio basic from introduction to proficiency] detailed introduction of trio as a slave station connecting to the third-party bus (anybus PROFIBUS DP...)
Explication de la procédure stockée pour SQL Server
Several implementation schemes of anti reverse connection protection of positive and negative poles of power supply!