STM8L_3_KEY:
1.User:工程及main文件
2.Hardware:KEY,CLK,LED,Delay
3.STM8L15x_StdPeriph_Driver:STM8自带库文件
4.Debug:hex文件存放于EXE文件夹
5.Function: Press KEY,LED Light
- /**
- ******************************************************************************
- * @file main.c
- * @author Alex——小白
- * @version V1.0
- * @date 2019.5.1
- * @brief KEY is used for lighting LED
- ******************************************************************************
- * @attention All Rights Reserved
- **/
-
- #include <stdint.h>
- #include <string.h>
- #include "stm8l15x.h"
- #include "LED.h"
- #include "Delay.h"
- #include "CLK.h"
- #include "KEY.h"
-
- void main(void)
- {
- CLK_HSI_Config(CLK_SYSCLKDiv_8); //HSI 8分频 2MHz
- LED_Init();
- KEY_Init();
- while(1)
- {
- if(KEY_Read() == FALSE)
- {
- Delay(0x7FFF);
- if(KEY_Read() == FALSE)
- {
- LED0(0);
- }
- }
- else LED0(1);
- }
- }
复制代码
STM8L_3_KEY.7z
(2.03 MB, 下载次数: 30)
|