Skip to main content
Visitor II
March 16, 2023
Question

How do I output an Integer over USB?

  • March 16, 2023
  • 1 reply
  • 1289 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

    Graduate II
    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.