水管清洗ESP32 腳位34 連接到可變電阻腳位 2
ESP32 腳位VIN 毗連到可變電阻腳位 1
ESP32 腳位GND 毗鄰到可變電阻腳位 3
讀取數值為12 bits = 4096
0 - 4095
程式碼:
- const int potPin = 34;
- int val=0;
- void setup() {
- Serial.begin(115200); //連線速度
- delay(1000);
- }
- void loop() {
- // put your main code here, to run repeatedly:
- val = analogRead(potPin); //讀取電壓數值
- Serial.println(val); //印出電壓數值
- delay(500); //延遲0.5秒
- }
影片說明:
文章出處:網頁設計,網站架設 ,網路行銷,網頁優化,SEO -水管清洗 NetYea 網頁設計
引用自:
文章標籤
全站熱搜