c_cpp sprintf.esp8266.ino

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了c_cpp sprintf.esp8266.ino相关的知识,希望对你有一定的参考价值。

/*
 *  This sketch demonstrates how to scan WiFi networks. 
 *  The API is almost the same as with the WiFi Shield library, 
 *  the most obvious difference being the different file you need to include:
 */
#include "ESP8266WiFi.h"

void setup() {
  Serial.begin(115200);

  // Set WiFi to station mode and disconnect from an AP if it was previously connected
  WiFi.mode(WIFI_STA);
  WiFi.disconnect();
  delay(100);

  Serial.println("Setup done");
}

void loop() {
  Serial.println("=====DONE======");
  char buff[20];
  
  String a = String(5.4);
  sprintf(buff, "%s, %s %d %s", "HELLO", "WORLD", 300, (char*)a.c_str());
  
  Serial.println(buff);
  // Wait a bit before scanning again
  delay(5000);
}

以上是关于c_cpp sprintf.esp8266.ino的主要内容,如果未能解决你的问题,请参考以下文章

c_cpp EEPROM_STRING_ESP8266.ino

c_cpp 130.周围地区

c_cpp 200.岛屿数量

c_cpp 127.单词阶梯

c_cpp MOFSET

c_cpp MOFSET