# NodeMCU-32s開發板環境
###### tags: `esp32`
###### 撰寫時間 : 2021/11/07
## 環境
1. 安裝Arduino IDE
2. 選擇File/Peference/addition boards manager URL貼上
```
https://dl.espressif.com/dl/package_esp32_index.json
```
3. Tools > Board -> Boards Manager -> esp32 -> install
4. 安裝[CH340 驅動](https://learn.sparkfun.com/tutorials/how-to-install-ch340-drivers#windows-710)
---
也可安裝VScode的外掛`PlatformIO`,相關教學如下 :
- [How To Install PlatformIO (ESP32 + Arduino series)](https://www.youtube.com/watch?v=5edPOlQQKmo)
- [#264 PlatformIO for Arduino, ESP8266, and ESP32 Tutorial](https://www.youtube.com/watch?v=0poh_2rBq7E)
- [ESP32超详细教程-使用VSCode(基于Arduino框架)](https://www.bilibili.com/video/BV1tv411w74d)
- [PlatformIO - Using External Libraries](https://www.youtube.com/watch?v=EBlHNBNHESQ)
## Pinout
- datasheet : [NodeMCU-32 规格书](https://docs.ai-thinker.com/_media/esp32/docs/nodemcu-32_v1.3%E8%A7%84%E6%A0%BC%E4%B9%A6_-.pdf)
- **教學(重要,須留意各腳位的限制) : [ESP32 Pinout Reference](https://randomnerdtutorials.com/esp32-pinout-reference-gpios/)**



## ESP32系列晶片

> NodeMCU-32s開發板使用ESP32系列中的ESP32-S晶片
## 比較
| 項目 | Arduino UNO | ESP8266 | ESP32 |
|:------------:|:--------------:|:---------------------------:|:-------------------------:|
| MCU | AVR ATMega328P | Tensilica Xtensa LX106 | Tensilica Xtensa LX6 |
| 核心 | 單核20 MHz | 單核80/160 MHz | 雙核160/240 MHz |
| 資料寬度 | 8bit | 32bit | 32bit |
| SRAM | 16 KB | 160 KB | 512 KB |
| Flash | 32 KB | 1-4 MB | 4-32 MB |
| GPIO | 13 | 8 | 18 |
| ADC(類比) | 8 | 1 | 18 |
| PWM | 6 | 8 | 16 |
| 類比解析度 | 1023 | 1023 | 4095 |
| 12C組數 | 1 | 1 | 2 |
| SPI組數 | 1 | 1 | 3 |
| 12S組數 | 1 | 1 | 2 |
| UART組數 | 1 | 1 | 3(硬體) |
| OTA更新 | x | 支援 | 支援 |
| 內建WiFi | x | 802.11b/g/n | 802.11b/g/n |
| 內建藍芽 | x | x | BLE 4.2 |
| 內建觸控電容 | x | x | 10 |
| 內建溫度感測 | x | x | 1 |
| 內建霍爾感測 | x | x | 1 |
| 網路售價(NT) | 200 | 200 | 200 |
## 參考資料
- [Install Serial Drivers for ESP32 (macOS, Windows, Linux)](https://www.youtube.com/watch?v=MM9Fj6bwHLk)
- [Introduction to ESP32 - Getting Started](https://www.youtube.com/watch?v=xPlN_Tk3VLQ)
- [第一篇 ESP32 Arduino開發環境架設](https://youyouyou.pixnet.net/blog/post/119410732)