STM8L_6_EXIT:
1.User: Project and main files
2.Hardware:EXIT,CLK,LED,Delay
3.STM8L15x_StdPeriph_Driver: STM8 comes with library files
4.Debug: The hex file is stored in the EXE folder
5.Function: External interrupt rising edge trigger, flip LED
/**
******************************************************************************
* @file main.c
* @author Alex——Xiaobai
* @version V1.0
* @date 2019.5.1
* @brief External interruption lighting
* @store has a Proteus simulation store
* @Link https://shop484534014.taobao.com/
* @Email 844545015@qq.com
******************************************************************************
* @attention All Rights Reserved
**/
#include "stm8l15x.h"
#include "LED.h"
#include "Delay.h"
#include "CLK.h"
#include "EXIT.h"
void main(void)
{
CLK_HSI_Config(CLK_SYSCLKDiv_1); //HSI 1分频 16MHz
LED_Init(); //LED FLash
EXIT_Init();
enableInterrupts();
while(1)
{
}
}
INTERRUPT_HANDLER(EXTI3_IRQHandler,11)
{
/* In order to detect unexpected events during development,
it is recommended to set a breakpoint on the following instruction.
*/
if(GPIO_ReadInputDataBit(KEY_IOPORT,GPIO_Pin_3) == RESET) //If there is another pin 3, such as PA3, you can use if again to determine whether PA3 is 0 to distinguish PD3
{
Delay(0x7FFF); //nearly 10ms
if(GPIO_ReadInputDataBit(KEY_IOPORT,GPIO_Pin_3) == RESET)
{
LED0_Toggle();
}
}
EXTI_ClearITPendingBit(EXTI_IT_Pin3);
}
Previous article:STM8L151C8 MCU learning routine (7) - ADC acquisition, serial port sending voltage value
Next article:STM8L151C8 MCU learning routine (5)——TIMER1 timing 0.5s
- 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
- CGD and Qorvo to jointly revolutionize motor control solutions
- CGD and Qorvo to jointly revolutionize motor control solutions
- Keysight Technologies FieldFox handheld analyzer with VDI spread spectrum module to achieve millimeter wave analysis function
- Infineon's PASCO2V15 XENSIV PAS CO2 5V Sensor Now Available at Mouser for Accurate CO2 Level Measurement
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- A new chapter in Great Wall Motors R&D: solid-state battery technology leads the future
- Naxin Micro provides full-scenario GaN driver IC solutions
- Interpreting Huawei’s new solid-state battery patent, will it challenge CATL in 2030?
- Are pure electric/plug-in hybrid vehicles going crazy? A Chinese company has launched the world's first -40℃ dischargeable hybrid battery that is not afraid of cold
- NRF24L01 module usage
- AD 20.2.4 x64
- Design and implementation of high-speed SRIO interface of TMS320C6455
- When the frequency of PWM square wave signal is low, voltage overshoot and ringing will occur?
- 【bk7231N】Exploration of Tuya products in SPI and other communication aspects
- Commonly used algorithms for drones - Kalman filter (VII)
- Does the Internet of Things mean the Internet of Everything?
- ST Live: ST's AI on the Edge - Anomaly Detection Solution Based on NanoEdge AI
- Summary of board games
- [Xingkong Board Python Programming Learning Main Control Board] Use of various sensor functions and network connection