本站改版新增arduino频道
arduino 获取硬件ID 方式1
#include "WiFi.h" void setup() { Serial.begin(115200); WiFi.mode(WIFI_MODE_STA); String str = WiFi.macAddress(); str.replace(":", ""); Serial.println(str); String htmlurl = "http://wcard.4936.cn/api_index.php?mid=" + str; Serial.println(htmlurl); } void loop() { } uint32_t chipId = 0; void setup() { Serial.begin(115200); } void loop() { for(int i=0; i<17; i=i+8) { chipId |= ((ESP.getEfuseMac() >> (40 - i)) & 0xff) << i; } Serial.printf("ESP32 Chip model = %s Rev %d\n", ESP.getChipModel(), ESP.getChipRevision()); Serial.printf("This chip has %d cores\n", ESP.getChipCores()); Serial.print("Chip ID: "); Serial.println(chipId); String str = String(chipId); htmlurl = "http://wcard.4936.cn/api_index.php?mid=" + str; Serial.println(htmlurl); delay(3000); }
Copyright © 2014 ESP56.com All Rights Reserved
晋ICP备14006235号-22 晋公网安备14108102001165号
执行时间: 0.0096859931945801 seconds