I’m using an ESP32 to send UART data to a PC.
Is this:
uint16_t meas;
while(1){
\ get meas data
printf("%ur",meas);
}
any different from this:
uint16_t meas;
while(1){
\ get meas data
uart_write_bytes(EX_UART_NUM, (const char*) meas, meas.size);
char r = 'r';
uart_write_bytes(EX_UART_NUM, (const char*) r, r.size);
}
i.e. does the PC receive a different amount of bits for each case? The latter uses the espidf driver/uart.h
lib.
I expect both to be the same but am unsure how the printf
function operates. I assume printf
may send a bunch of extra characters for each digit?
New contributor
Richie Ellingham is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.