Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- switch (state)
- {
- case a:
- HAL_ADC_Start(&hadc1);
- HAL_ADC_PollForConversion(&hadc1, 1);
- raw = HAL_ADC_GetValue(&hadc1);
- raw_to_volt = (raw * 3.3) / 4095;
- HAL_ADC_Stop(&hadc1);
- sprintf(msg, "(%lu) Hall sensor: %.4f [V]\r\n", HAL_GetTick()/100, raw_to_volt);
- HAL_UART_Transmit(&hlpuart1, (uint8_t*)msg, strlen(msg), 10);
- flag_sensor = 0;
- break;
- case b:
- /* reading tension and checking the value */
- break;
- case c:
- /* danger state code */
- break;
- case d:
- /* waiting state code */
- break;
- default:
- break;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement