效果演示:转换为str*后通过u8g2显示在OLED上。
代码:
// ...
str *ip = '0.0.0.0';
//WiFi.localIP().toString().c_str();
strcpy(ip, WiFi.localIP().toString().c_str()); // 先获取到IP并转换为str*,然后通过strcpy进行复制
println(ip); // 即可获得
// ...
效果演示:转换为str*后通过u8g2显示在OLED上。
代码:
// ...
str *ip = '0.0.0.0';
//WiFi.localIP().toString().c_str();
strcpy(ip, WiFi.localIP().toString().c_str()); // 先获取到IP并转换为str*,然后通过strcpy进行复制
println(ip); // 即可获得
// ...