شِفر (کود) جستجو

Reading Potentiometer Voltage Using an ESP32 Microcontroller

Reading Potentiometer Voltage Using an ESP32 Microcontroller

This video shows how to start reading potentiometer voltage at analog inputs of the ESP32. Pins and potentiometers are explained.

تصاویر

خواندن ولتاژ پتانسیومتر با استفاده از میکروکنترلر ESP32 از پایه‌های آنالوگ
خواندن ولتاژ پتانسیومتر با استفاده از میکروکنترلر ESP32 از پایه‌های آنالوگ
243-Arduino code
زبان: C++
/*
  ESP32 Analog Read
  Read potentiometer voltage at different inputs

  Written by Ahmad Shamshiri at 20:55
  on Sunday, September 1, 2019 in Ajax, Ontario, Canada

  Watch video instructions for this sketch: 
https://youtu.be/UXKu2Xtwj7c
 
*/

const int potPin = 39;// Analog pin

int potValue;// do not change
float voltage =0;// do not change


void setup() {
  // initialize serial communication at 115200 bits per second:
  Serial.begin(115200);
}


void loop() {
  // read the input on analog pin potPin:
  potValue = analogRead(potPin);
  voltage = (3.3/4095.0) * potValue;
  Serial.print("potValue:");
  Serial.print(potValue);
   
  Serial.print(" Voltage:");
  Serial.print(voltage);
  Serial.println("V");  
  delay(50); // delay in between reads for stability
}

منابع و مراجع

هنوز هیچ منبعی موجود نیست.

فایل‌ها📁

هیچ فایلی موجود نیست.