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:如何转换为 ASCII 并发送回 PC。

Guru**** 2601915 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/745023/ccs-tm4c123ge6pm-how-to-convert-to-ascii-and-send-back-to-pc

器件型号:TM4C123GE6PM

工具/软件:Code Composer Studio

大家好、我需要编写一个代码来跟踪开关被按下的次数、并每10秒以 ASCII 格式将该数字发送到 PC。 例如,如果按21次 Switch 1,则每10秒发送到 PC 的字符串将为“[21]”。 首先、我将创建一个用作计数的变量、并在每次按下按钮时使其值增加、但我不理解如何使用 ASCII 发送信息"21"。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    您好、Monica、

    为此、您可以使用 UART 并利用附带的 TivaWare API、例如 UARTprintf。 您可以在 Tivaware 示例'interrupts'和'timers'中看到一些数据输出的示例。 计时器示例将对您获取10秒计数器也很有帮助、如果您没有在中断上进行开关计数、您将需要查看中断示例以了解如何实现该操作。