当前位置:网站首页>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
边栏推荐
- Sql Server的存儲過程詳解
- Ble encryption details
- Programming knowledge -- assembly knowledge
- Talk about the function of magnetic beads in circuits
- Count the number of inputs (C language)
- Stablq of linked list
- C, Numerical Recipes in C, solution of linear algebraic equations, LU decomposition source program
- FIO测试硬盘性能参数和实例详细总结(附源码)
- Sizeof (function name) =?
- After installing the new version of keil5 or upgrading the JLINK firmware, you will always be prompted about the firmware update
猜你喜欢
Halcon's practice based on shape template matching [1]
MySQL之MHA高可用集群
Reasons for rapid wear of conductive slip rings
[cloud native | learn kubernetes from scratch] III. kubernetes cluster management tool kubectl
Ble encryption details
Some thoughts on extracting perspectives from ealfa and Ebeta
Improve lighting C program
Design a clock frequency division circuit that can be switched arbitrarily
C # joint configuration with Halcon
Correlation based template matching based on Halcon learning [II] find_ ncc_ model_ defocused_ precision. hdev
随机推荐
Basic embedded concepts
Synchronization of QT multithreading
Explication de la procédure stockée pour SQL Server
Sql Server的存储过程详解
STM32 single chip microcomputer -- debug in keil5 cannot enter the main function
The firmware of the connected j-link does not support the following memory access
STM32 --- serial port communication
99 multiplication table (C language)
Simple design description of MIC circuit of ECM mobile phone
Relationship between line voltage and phase voltage, line current and phase current
Count the number of inputs (C language)
Embedded composition and route
【云原生 | 从零开始学Kubernetes】三、Kubernetes集群管理工具kubectl
MySQL之MHA高可用集群
Bootloader implementation of PIC MCU
C WinForm [help interface - send email] - practice five
Verilog -- state machine coding method
Various types of questions judged by prime numbers within 100 (C language)
Basic information commands and functions of kernel development
OLED 0.96 inch test