ESP8266
[ESP8266] Chip Information 읽기
트라이문
2017. 2. 15. 20:01
원래는 Chip ID 만 알려고 했다가,
구글링을 해 보니, 더 많은 정보를 얻을 수 있었습니다.
다음 사이트에서 참고했습니다.
https://github.com/adafruit/ESP8266-Arduino
그냥 스케치 프로그램만 건드리면 되네요.
소스 코드는 다음과 같습니다.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | void setup() { char ser_tx_buff[100]; Serial.begin(115200); Serial.println(); //ESP.getFreeHeap();// returns the free heap size. //ESP.getChipId();// returns the ESP8266 chip ID as a 32-bit integer. //Several APIs may be used to get flash chip info: //ESP.getFlashChipId();// returns the flash chip ID as a 32-bit integer. //ESP.getFlashChipSize();// returns the flash chip size, in bytes, as seen by the SDK (may be less than actual size). //ESP.getFlashChipSpeed();// returns the flash chip frequency, in Hz. //ESP.getCycleCount();// returns the cpu instruction cycle count since start as an unsigned 32-bit. This is useful for accurate timing of very short actions like bit banging. sprintf(ser_tx_buff,"1. getFreeHeap = %d\n\r",ESP.getFreeHeap()); Serial.print(ser_tx_buff); sprintf(ser_tx_buff,"2. getChipId = %d\n\r",ESP.getChipId()); Serial.print(ser_tx_buff); sprintf(ser_tx_buff,"3. getFlashChipId = %d\n\r",ESP.getFlashChipId()); Serial.print(ser_tx_buff); sprintf(ser_tx_buff,"4. getFlashChipSize = %d\n\r",ESP.getFlashChipSize()); Serial.print(ser_tx_buff); sprintf(ser_tx_buff,"5. getFlashChipSpeed = %d\n\r",ESP.getFlashChipSpeed()); Serial.print(ser_tx_buff); sprintf(ser_tx_buff,"5. getCycleCount = %d\n\r",ESP.getCycleCount()); Serial.print(ser_tx_buff); // put your setup code here, to run once: } void loop() { // put your main code here, to run repeatedly: } | cs |