arduino-esp32/libraries/ESP32/examples/ChipID/GetChipID/GetChipID.ino
WEMOS Electronics a38ffe58fe Add ESP.getChipId() function to get ESP32's ChipID. (#322)
* Add ESP.getChipId() function to get ESP32's ChipID.

* change getChipId() to getEfuseMac()
2017-05-05 09:59:54 +03:00

15 lines
327 B
C++

uint64_t chipid;
void setup() {
Serial.begin(115200);
}
void loop() {
chipid=ESP.getEfuseMac();//The chip ID is essentially its MAC address(length: 6 bytes).
Serial.printf("ESP32 Chip ID = %04X",(uint16_t)(chipid>>32));//print High 2 bytes
Serial.printf("%08X\n",(uint32_t)chipid);//print Low 4bytes.
delay(3000);
}