Hi Sara and Rui
First I wanted to thank you for all the material you have put together and I look forward to continuing to learn from you guys!
Second, I’ve been meaning to ask for a comparison of esp32 vs esp8266. It was always my understanding that the esp32 was a “better version” of esp8266. So then why continue to use the esp8266? What are the pro’s and con’s for either, and when to select one or the other?
Thanks for following our work.
In our opinion, the ESP32 is a better version of ESP8266. However, some people still prefer to use the ESP8266. It is cheaper and there are libraries and integrations for the ESP8266 that might not be still available for the ESP32. Additionally, many people have ESP8266 boards before the ESP32 came out, so they still prefer to use it.
For an in-depth comparison, you can read the following articles (written by us – MakerAdvisor ir part of RandomNerdTutorials)
I hope this helps.
In general, can code written for an esp8266 be used for an esp32 ?
What edits would need to be considered?
It depends on the application.
If you’re importing libraries, some are compatible with both boards. Others are just compatible with one board or the other.
For example, when using Wi-Fi, the ESP32 uses the WiFi.h library, whereas the ESP8266 uses the ESP8266WiFi.h library.
You also have to take into account that the pinout of the ESP32 is different from the pinout of the ESP8266.
You need to take that into account when declaring your pins.
Because the ESP32 and ESP8266 are different, there are some features you’ll only find on the ESP32 like Bluetooth or dual core, for example.