Difference between revisions of "ESP32: analogRead"

From OnnoWiki
Jump to navigation Jump to search
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
 
  void setup() {
 
  void setup() {
 
   Serial.begin(115200);
 
   Serial.begin(115200);
Line 5: Line 4:
 
   
 
   
 
  void loop() {
 
  void loop() {
   int sensorReading = analogRead(15); //cek pin di layout
+
   int sensorReading = analogRead(4); // connect ke D4
 
   Serial.println(sensorReading);  
 
   Serial.println(sensorReading);  
 
   delay(1000);
 
   delay(1000);
 
  }
 
  }
 +
// nilai max 4096
 +
 +
==Pranala Menarik==
 +
 +
* [[ESP32]]

Latest revision as of 19:14, 24 February 2023

void setup() {
  Serial.begin(115200);
}

void loop() {
  int sensorReading = analogRead(4); // connect ke D4
  Serial.println(sensorReading); 
  delay(1000);
}
// nilai max 4096

Pranala Menarik