• 大小: 1.25MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-10-30
  • 语言: 其他
  • 标签: stm32  串口  PWM  LED  

资源简介

STM32F103ZE的串口接收 PWM的LED亮度控制 STemWinGUI

资源截图

代码片段和文件信息

/***********************************************
  * @file    LEDControl.c
  * @author  BJXYD
  * @version V1.0
  * @date    2017-05-23
  * @brief   main
************************************************/ 

#include 
#include 
#include 
#include “systick.h“
#include “nvic.h“
#include “lcddrv.h“
#include “led.h“
#include “usart.h“
#include “timer.h“
#include “pwm.h“
#include “GUI.h“
#include “ExtFraFontsPlus.h“

// @brief  main
// @param  None
// @retval None
int main(void)
{
u8 LedLight=0;

// SysTick
SysTick_Init();

// NVIC
NVIC_SetPriorityGrouping(Group5g2s2);

// TIMER
TIM2_Init(7200100);

// PWM
TIM3_Init();

// USART
USART1_Init();

// GUI
GUI_CRC_Enable();
GUI_Init();

// Font
GUI_SetFont(&GUI_FontExtFraFonts);

// Color
GUI_SetBkColor(GUI_BLUE);
GUI_SetColor(GUI_BLACK);
GUI_Clear();
GUI_DrawGradientV(00239319GUI_BLUEGUI_LIGHTBLUE);

GUI_GotoXY(1010);  
  GUI_DispString(“LEDControl“);

GUI_GotoXY(1030);  
  GUI_DispString(“Light:“);
  
  GUI_DispStringAt(“%“11030);
GUI_DispDecAt(LedLight80303);

while(1)
{
if(USART1_Recv_Len!=0)
{
LedLight = (u8)atoi((const char *)USART1_Rec_DataBuf);

GUI_ClearRect(803010546);
GUI_DispDecAt(LedLight80303);
// SysTick_Delay_mS(200);

TIM3_CH2_PWM_VAL = LedLight;
  }
}
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2017-05-24 09:02  LEDControl\
     目录           0  2017-05-24 09:02  LEDControl\DebugConfig\
     目录           0  2017-05-24 08:52  LEDControl\Document\
     文件         369  2017-05-24 08:52  LEDControl\Document\LEDControl.txt
     目录           0  2017-05-24 08:54  LEDControl\Include\
     文件       57002  2017-05-24 08:54  LEDControl\Include\ExtFraFontsPlus.h
     文件        1338  2017-05-24 08:53  LEDControl\Include\lcddrv.h
     文件         124  2017-05-24 08:53  LEDControl\Include\led.h
     文件         392  2017-05-24 08:54  LEDControl\Include\nvic.h
     文件         126  2017-05-24 08:54  LEDControl\Include\pwm.h
     文件         167  2017-05-24 08:54  LEDControl\Include\systick.h
     文件         178  2017-05-24 08:54  LEDControl\Include\timer.h
     文件         371  2017-05-24 08:54  LEDControl\Include\usart.h
     文件      218917  2017-05-24 09:01  LEDControl\JlinkLog.txt
     文件         755  2017-05-24 09:00  LEDControl\JlinkSettings.ini
     文件        1425  2017-05-24 09:02  LEDControl\LEDControl.c
     文件       85338  2017-05-24 09:02  LEDControl\LEDControl.uvguix.HE
     文件       11572  2017-05-24 09:02  LEDControl\LEDControl.uvoptx
     文件       19220  2017-05-24 09:01  LEDControl\LEDControl.uvprojx
     目录           0  2017-05-24 09:02  LEDControl\Listings\
     目录           0  2017-05-24 09:02  LEDControl\objects\
     文件         154  2017-05-24 08:44  LEDControl\ProjectClear.bat
     目录           0  2017-05-24 08:47  LEDControl\RTE\
     目录           0  2017-05-24 08:46  LEDControl\RTE\Device\
     目录           0  2017-05-24 08:46  LEDControl\RTE\Device\STM32F103ZE\
     文件       63125  2016-03-29 09:46  LEDControl\RTE\Device\STM32F103ZE\RTE_Device.h
     文件       15503  2012-01-24 12:06  LEDControl\RTE\Device\STM32F103ZE\startup_stm32f10x_hd.s
     文件       36557  2012-01-24 12:06  LEDControl\RTE\Device\STM32F103ZE\system_stm32f10x.c
     目录           0  2017-05-24 08:47  LEDControl\RTE\_LEDControl\
     文件         352  2017-05-24 08:47  LEDControl\RTE\_LEDControl\RTE_Components.h
     目录           0  2017-05-24 08:46  LEDControl\RTE\_Target_1\
............此处省略117个文件信息

评论

共有 条评论