影片申明:
文章出:,站架 ,路行,化,SEO - NetYea
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秒
- }
代 本篇文章引用自此: 站架 文章定位: