Question
The code below gives an error 'pot' undeclared (first use in this function). How can I fix it? HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_1); HAL_ADC_Start(&hadc1); pot = HAL_ADC_GetValue(&hadc1);
The code below gives an error " 'pot' undeclared (first use in this function)". How can I fix it?
HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_1); HAL_ADC_Start(&hadc1); pot = HAL_ADC_GetValue(&hadc1);
if (pot >= 0 && pot < 500) { //AKTF ETTN PN } else if (pot >= 508 && pot < 1016) { //AKTF ETTN PN
}
else if (pot >= 1000 && pot < 1530) { //AKTF ETTN PN
} else if (pot >= 1530 && pot < 2040) { //AKTF ETTN PN
} else if (pot >= 2040 && pot < 2545) { //AKTF ETTN PN
} else if (pot >= 2545 && pot < 3040) { //AKTF ETTN PN
} else if (pot >= 3040 && pot < 3555) { //AKTF ETTN PN
} else if (pot >= 3555 && pot < 4095) { //AKTF ETTN PN
}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started