Skip to main content
GTann.1
Associate II
March 16, 2023
Question

How do I output an Integer over USB?

  • March 16, 2023
  • 1 reply
  • 1674 views

I am trying to send some communication from an Nucleo-F412ZG board over USB. I am currently using CDC_Transmit_FS function but this seems to only send char values and I would like to be able to send an uint8_t variable and have it come out as a meaningful set of characters, is there a way to do this with the CDC_Transmit_FS function or do I need to use something else?

This topic has been closed for replies.

1 reply

Tesla DeLorean
Guru
March 16, 2023

You'd need to create the ASCII or human readable forms with sprintf() or itoa() into character strings,and then cast those into (uint8_t *) collections of bytes.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..