当前位置:网站首页>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
边栏推荐
- Connection mode - bridge and net
- Measurement fitting based on Halcon learning [II] meaure_ pin. Hdev routine
- Various types of questions judged by prime numbers within 100 (C language)
- Summary of SIM card circuit knowledge
- Briefly talk about the identification protocol of mobile port -bc1.2
- Brief discussion on Buck buck circuit
- Network port usage
- Shape template matching based on Halcon learning [v] find_ cocoa_ packages_ max_ deformation. Hdev routine
- Shape template matching based on Halcon learning [9] PM_ multiple_ dxf_ models. Hdev routine -- [read and write XLD from DXF file]
- Makefile application
猜你喜欢

Semiconductor devices (I) PN junction

Matlab2018b problem solving when installing embedded coder support package for stmicroelectronic

Talk about the function of magnetic beads in circuits

Solutions to compilation warnings in Quartus II

QEMU STM32 vscode debugging environment configuration

Count the number of inputs (C language)

Array integration initialization (C language)

Classic application of MOS transistor circuit design (2) - switch circuit design

Installation and use of libjpeg and ligpng

Factors affecting the quality of slip rings in production
随机推荐
Hardware and software solution of FPGA key chattering elimination
Measurement fitting based on Halcon learning [III] PM_ measure_ board. Hdev routine
On boost circuit
Reasons for rapid wear of conductive slip rings
STM32 single chip microcomputer - external interrupt
My-basic application 2: my-basic installation and operation
Anonymous structure in C language
QEMU STM32 vscode debugging environment configuration
Adaptive filter
Factors affecting the quality of slip rings in production
Soem EtherCAT source code analysis II (list of known configuration information)
Carrier period, electrical speed, carrier period variation
Introduction of air gap, etc
C language # and #
Makefile application
Embedded composition and route
QEMU demo makefile analysis
C, Numerical Recipes in C, solution of linear algebraic equations, LU decomposition source program
Halcon's practice based on shape template matching [2]
Compilation warning solution sorting in Quartus II