#include "stm32f10x.h"
#include "delay.h"
void Delay(u32 count)
{
u32 i=0;
for(;i } int main(void) { GPIO_InitTypeDef GPIO_InitStructure; RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE); //Enable PA delay_init(); GPIO_InitStructure.GPIO_Pin = GPIO_Pin_8; //LED0-->PA.8 port configuration GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP; //Push-pull output GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; //IO port speed is 50MHz GPIO_Init(GPIOA, &GPIO_InitStructure); //Initialize GPIOA according to the set parameters.8 GPIO_SetBits(GPIOA,GPIO_Pin_8); //PA.8 output high // GPIO_InitStructure.GPIO_Pin = GPIO_Pin_2; //LED1-->PD.2 port configuration, push-pull output // GPIO_Init(GPIOD, &GPIO_InitStructure); //Push-pull output, IO port speed is 50MHz //GPIO_SetBits(GPIOD,GPIO_Pin_2); //PD.2 output high while(1) { GPIO_SetBits(GPIOA,GPIO_Pin_8); //GPIO_SetBits(GPIOD,GPIO_Pin_2); delay_ms(1000); GPIO_ResetBits(GPIOA,GPIO_Pin_8); //GPIO_ResetBits(GPIOD,GPIO_Pin_2); delay_ms(1000); } } Before trying the dealy_ms function, first initialize delay_init. Enable GPIO clock and configure IO port mode The output mode is set to push-pull output, the output frequency is 50MHZ The red light corresponds to pin GPIOA_Pin_8; The yellow light corresponds to the pin GPIOD_Pin_2
Previous article:STM32 learning notes (II) key experiment
Next article:Summary of the general timer PWM experiment of STM32F107
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Wi-Fi 8 specification is on the way: 2.4/5/6GHz triple-band operation
- Wi-Fi 8 specification is on the way: 2.4/5/6GHz triple-band operation
- Vietnam's chip packaging and testing business is growing, and supply-side fragmentation is splitting the market
- Vietnam's chip packaging and testing business is growing, and supply-side fragmentation is splitting the market
- Three steps to govern hybrid multicloud environments
- Three steps to govern hybrid multicloud environments
- Microchip Accelerates Real-Time Edge AI Deployment with NVIDIA Holoscan Platform
- Microchip Accelerates Real-Time Edge AI Deployment with NVIDIA Holoscan Platform
- Melexis launches ultra-low power automotive contactless micro-power switch chip
- Melexis launches ultra-low power automotive contactless micro-power switch chip
- Qinheng CH579M-R1 development board evaluation report summary
- [Speech and vision module based on ESP32S3] First version of schematic diagram and circuit design
- Share MSP430 serial port receiving control LED
- Today's live broadcast: Third-generation TI C2000 new features resource update
- Xunwei-iMX6ULL development board-transplant mjpg-streamer to achieve remote monitoring
- Zero Knowledge Open Source Sharing - L298N module uses motor to drive TT motor
- Can you tell me the steps to construct a distance 3 Hamming code?
- CC3200-LAUNCHXL development board experience sharing - CC3200 Getting Started - cugxiao
- Please help me find out how this formula is calculated, thank you
- Digital Modulation Series: Basic Theory of IQ Modulation