Page 230 - 완) I MDP 프로젝트 작품 보고서(전체과 1학년)1.6
P. 230
/* USER CODE BEGIN 0 */
/* USER CODE END 0 */
int main(void)
{
/* USER CODE BEGIN 1 */
unsigned char uartData[20],carDir;
int i=0,rh,temp;
/* USER CODE END 1 */
/* MCU
Configuration----------------------------------------------------------*/
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
HAL_Init();
/* Configure the system clock */
SystemClock_Config();
/* Initialize all configured peripherals */
MX_GPIO_Init();
MX_USART2_UART_Init();
MX_TIM4_Init();
MX_TIM3_Init();
MX_TIM2_Init();
MX_TIM1_Init();
/* USER CODE BEGIN 2 */
HAL_TIM_IC_Start(&htim1,TIM_CHANNEL_1);
HAL_TIM_PWM_Start(&htim2,TIM_CHANNEL_1);
HAL_TIM_IC_Start(&htim2,TIM_CHANNEL_2);
HAL_TIM_PWM_Start(&htim3,TIM_CHANNEL_1);
HAL_TIM_PWM_Start(&htim4,TIM_CHANNEL_1); //pwm (동작시작)
HAL_TIM_PWM_Start(&htim4,TIM_CHANNEL_2);
/* USER CODE END 2 */
- 223 -