intmain(void){/* USER CODE BEGIN 1 */uint32_t aCCValue_Buffer[3]={0,0,0};/* Compute CCR1 value to generate a duty cycle at 80% */aCCValue_Buffer[2]=(uint32_t)(((uint32_t)80*(10000-1))/100);//84000 000/* Compute CCR1 value to generate a duty cycle at 50% */aCCValue_Buffer[1]=(uint32_t)(((uint32_t)50*(10000-1))/100);/* Compute CCR1 value to generate a duty cycle at 25% */aCCValue_Buffer[0]=(uint32_t)(((uint32_t)25*(10000-1))/100);/* USER CODE END 1 *//* MCU Configuration--------------------------------------------------------*//* Reset of all peripherals, Initializes the Flash interface and the Systick. */HAL_Init();/* USER CODE BEGIN Init *//* USER CODE END Init *//* Configure the system clock */SystemClock_Config();/* USER CODE BEGIN SysInit *//* USER CODE END SysInit *//* Initialize all configured peripherals */MX_GPIO_Init();MX_DMA_Init();MX_TIM1_Init();/* USER CODE BEGIN 2 *//*## Start PWM signal generation in DMA mode ############################*/if(HAL_TIM_PWM_Start_DMA(&htim1, TIM_CHANNEL_1, aCCValue_Buffer,3)!= HAL_OK){/* Starting Error */Error_Handler();}/* USER CODE END 2 *//* Infinite loop *//* USER CODE BEGIN WHILE */while(1){/* USER CODE END WHILE *//* USER CODE BEGIN 3 */}/* USER CODE END 3 */}
Alex教程每一P的教程原代码加上我自己的理解初步理解写的注释,可供学习Alex教程的人参考 此代码仅为较上一P有所改变的代码 【Unity教程】从0编程制作类银河恶魔城游戏_哔哩哔哩_bilibili UI_CraftList.cs
using System.Collections;
using System.Collections.Gen…