本站改版新增arduino频道

Micropython
Arduino

arduino 获取硬件Chip ID


arduino 获取硬件Chip ID

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);
  
        delay(3000);

}



推荐分享
图文皆来源于网络,内容仅做公益性分享,版权归原作者所有,如有侵权请告知删除!
 

Copyright © 2014 ESP56.com All Rights Reserved
晋ICP备14006235号-22 晋公网安备14108102001165号

执行时间: 0.0096359252929688 seconds