Micro-controllers, wireless transmission and database
This project assumes you have already installed STM32CubeIDE. You need to have previously done a basic blink sketch with blue-pill using STM32CubeIDE. I have made a complete video from installing STM32CubeIDE to LED blink program. You can watch it by clicking this link. https://www.youtube.com/watch?v=kXg467nVd_A
Click Timer → Click TIM2 →
Clock Source set to Internal Clock
Channel2 set to PWM Generation CH2
Configuration → Parameter Settings →
Prescaler set to 127
Counter Period 20
/* USER CODE BEGIN 2 */ HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_2); /* USER CODE END 2 */ /* Infinite loop */ /* USER CODE BEGIN WHILE */ while (1) { int x; for(x=10; x<30; x=x+1) { __HAL_TIM_SET_AUTORELOAD(&htim2, x*2); __HAL_TIM_SET_COMPARE(&htim2,TIM_CHANNEL_2, x); HAL_Delay(100); } /* USER CODE END WHILE */