当前位置:网站首页>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
边栏推荐
- [tutorial 15 of trio basic from introduction to proficiency] trio free serial communication
- Explain task scheduling based on Cortex-M3 in detail (Part 1)
- WiFi wpa_ Detailed description of supplicant hostpad interface
- Negative pressure generation of buck-boost circuit
- go依赖注入--google开源库wire
- 1-stm32 operation environment construction
- Detailed explanation of SQL server stored procedures
- STM32 --- GPIO configuration & GPIO related library functions
- Shape template matching based on Halcon learning [VII] reuse_ model. Hdev routine
- Charge pump boost principle - this article will give you a simple understanding
猜你喜欢
Take you to understand the working principle of lithium battery protection board
【云原生 | 从零开始学Kubernetes】三、Kubernetes集群管理工具kubectl
Hardware 3 -- function of voltage follower
[paper reading] the latest transfer ability in deep learning: a survey in 2022
Several implementation schemes of anti reverse connection protection of positive and negative poles of power supply!
Measurement fitting based on Halcon learning [i] fuse Hdev routine
Makefile application
C # joint configuration with Halcon
Charge pump boost principle - this article will give you a simple understanding
Summary -st2.0 Hall angle estimation
随机推荐
C WinForm [view status bar -- statusstrip] - Practice 2
Detailed explanation of SQL server stored procedures
MySQL MHA high availability cluster
[trio basic from introduction to mastery tutorial XIV] trio realizes unit axis multi-color code capture
Why is 1900 not a leap year
Problem solving: interpreter error: no file or directory
Anonymous structure in C language
[trio basic tutorial 18 from introduction to proficiency] trio motion controller UDP fast exchange data communication
On boost circuit
FIO测试硬盘性能参数和实例详细总结(附源码)
Summary -st2.0 Hall angle estimation
Reasons for rapid wear of conductive slip rings
C, Numerical Recipes in C, solution of linear algebraic equations, LU decomposition source program
STM32 single chip microcomputer -- debug in keil5 cannot enter the main function
STM32 --- GPIO configuration & GPIO related library functions
Class of color image processing based on Halcon learning_ ndim_ norm. hdev
Hardware and software solution of FPGA key chattering elimination
Circleq of linked list
Halcon's practice based on shape template matching [1]
leetcode - 445. 两数相加 II