2023-06-25 11:19 AM
Hello! Recently I have been working on ADC, where I connect a potentiometer to a bread board and by using jumper wires I connect it with ARM Cortex M4, STM32G491. Thankfully I have received the outputs too. But the challenge is, I have to include timer along with the voltage output. I did watch many tutorials available on internet, added few codes in it. The moment I run my code, It just shows the voltage reading not the timer reading. The code shows 0 error, I was wondering where I have mistaken, I was hoping if somebody could help me out with this challenge. I hereby attach my code in text form. Thank you :)
Solved! Go to Solution.
2023-06-25 12:30 PM - edited 2023-06-25 12:30 PM
Hello. Seems that you are sending time/date to other uart than the adc result. Is it on purpose ?
HAL_UART_Transmit(&huart3,(uint8_t*)date,sizeof(date),300); HAL_UART_Transmit(&huart3,(uint8_t*)time,sizeof(time),300); HAL_UART_Transmit(&hlpuart1,(uint8_t*)msg,strlen(msg),HAL_MAX_DELAY);
You could also use strlen on all transmittings, not sizeof.
2023-06-25 12:30 PM - edited 2023-06-25 12:30 PM
Hello. Seems that you are sending time/date to other uart than the adc result. Is it on purpose ?
HAL_UART_Transmit(&huart3,(uint8_t*)date,sizeof(date),300); HAL_UART_Transmit(&huart3,(uint8_t*)time,sizeof(time),300); HAL_UART_Transmit(&hlpuart1,(uint8_t*)msg,strlen(msg),HAL_MAX_DELAY);
You could also use strlen on all transmittings, not sizeof.