OLED_ShowString 函数用法详解:在 OLED 屏幕上显示字符串
OLED_ShowString 函数是用来在 OLED 屏幕上显示字符串的函数。它的用法如下:
void OLED_ShowString(uint8_t x, uint8_t y, uint8_t *str, uint8_t size)
参数说明:
- x:字符串的起始横坐标,范围为 0~127
 - y:字符串的起始纵坐标,范围为 0~63
 - str:要显示的字符串,使用 UTF-8 编码
 - size:字体大小,可选值为 12 或 16
 
示例代码:
#include "OLED.h"
void main() {
    OLED_Init();
    OLED_Clear();
    OLED_ShowString(0, 0, 'Hello, world!', 16);
}
该代码会在 OLED 屏幕上显示一个大小为 16 的 'Hello, world!' 字符串,起始位置为左上角。
原文地址: https://www.cveoy.top/t/topic/oPSb 著作权归作者所有。请勿转载和采集!