当前位置:网站首页>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
边栏推荐
- Soem EtherCAT source code analysis attachment 1 (establishment of communication operation environment)
- The firmware of the connected j-link does not support the following memory access
- Improve lighting C program
- Zero length array in GNU C
- C WinForm [view status bar -- statusstrip] - Practice 2
- Why is 1900 not a leap year
- Circleq of linked list
- Semiconductor devices (I) PN junction
- Some thoughts on extracting perspectives from ealfa and Ebeta
- Design a clock frequency division circuit that can be switched arbitrarily
猜你喜欢
实例007:copy 将一个列表的数据复制到另一个列表中。
Count the number of inputs (C language)
Classic application of MOS transistor circuit design (1) -iic bidirectional level shift
Negative pressure generation of buck-boost circuit
Consul installation
C, Numerical Recipes in C, solution of linear algebraic equations, LU decomposition source program
STM32 tutorial triple ADC interleaved sampling
The firmware of the connected j-link does not support the following memory access
STM32 virtualization environment of QEMU
Talk about the circuit use of TVs tube
随机推荐
MySQL MHA high availability cluster
Makefile application
Bootloader implementation of PIC MCU
Various types of questions judged by prime numbers within 100 (C language)
Measurement fitting based on Halcon learning [II] meaure_ pin. Hdev routine
FIO测试硬盘性能参数和实例详细总结(附源码)
Take you to understand the working principle of lithium battery protection board
Circleq of linked list
Explication de la procédure stockée pour SQL Server
C WinForm [help interface - send email] - practice five
Charge pump boost principle - this article will give you a simple understanding
Bluetooth hc-05 pairing process and precautions
MySQL之MHA高可用集群
List of linked lists
Hardware 1 -- relationship between gain and magnification
C WinForm [change the position of the form after running] - Practical Exercise 4
Shape template matching based on Halcon learning [9] PM_ multiple_ dxf_ models. Hdev routine -- [read and write XLD from DXF file]
Wifi-802.11 negotiation rate table
C WinForm [view status bar -- statusstrip] - Practice 2
Naming rules for FreeRTOS