This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/TM4C123GE6PM: How to convert to ASCII and send back to PC.

Part Number: TM4C123GE6PM

Tool/software: Code Composer Studio

Hi I need to write a code that tracks the number of times a switch has been pressed, and sends the number to PC in ASCII format at every 10 seconds. For examples, if Switch 1 has been pressed 21 times, the string that will be sent to PC at every 10 seconds is going to be “[21]”. I will start by creating a variable to serve as the count and making it's value increase with every button pressed, but I don't understand how ASCII can be used to send the info "21."

  • Hello Monica,

    You would use UART for this and leverage the included TivaWare API's such as UARTprintf. You can see some examples where data is printed out in the Tivaware examples 'interrupts' and 'timers'. The Timers example will be helpful for you to get the 10 second counter going as well, and if you haven't got the switch counting on an interrupt, you'll want to review the Interrupts example to get a feel on how to accomplish that as well.