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.
器件型号:MSP-EXP430F5438
工具/软件:Code Composer Studio
您好,
我正在使用 MSP-EXP430F5438试验板。
我已经学会使用 Grlib 和其他示例代码开发 LCD、音频和计时器代码。
我能够在 LCD 上显示图形图像和文本。 文本显示、如下所示。
graphics_drawStringCenter(&g_sContext,"Welcome",AUTO_STRING_LENGTH,69,27,Transparent_text);
但是、此处的文本始终是 上述函数中的"欢迎"等常量。 我想根据通过 UART 或 ADC 接收到的数据来更改文本。
因此、我将知道通过 UART 或 ADC 接收到了哪些数据。 或者、根据 UART 命令/数据、我希望显示不同的文本。
请告诉我我们是否可以根据 我的要求更改文本。
此致、
VR
只需创建字符串缓冲区并确保字符串以'\0'终止:
char msg[32]/*为消息留出32个字节*/
strcpy (msg、"Hello");
strcat (msg、"、World!\n");/*这些函数确保字符串以'\0'结束*/
graphics_drawStringCenter(&g_sContext、msg、AUTO_STRING_LENGTH、69、27、Transparent_text);
您好、Keith Barkley、
感谢您的快速回复。
它根据我的需要在您的建议之后工作。
此致、
VR