Difference between revisions of "WeMOS D1 mini: D1 read data"

From OnnoWiki
Jump to navigation Jump to search
(Created page with " →‎* D1 read data * * *: void setup() { pinMode(D1,INPUT); } void loop() { in = digitalRead(D1); delay(1000); }")
 
 
Line 9: Line 9:
 
  void setup() {
 
  void setup() {
 
   pinMode(D1,INPUT);
 
   pinMode(D1,INPUT);
 +
  // initialize serial communications at 9600 bps
 +
  Serial.begin(9600);
 
  }
 
  }
 
   
 
   
 
  void loop() {
 
  void loop() {
 
   in = digitalRead(D1);  
 
   in = digitalRead(D1);  
+
  Serial.println(in);
 +
  Serial.println("\n");
 
   delay(1000);
 
   delay(1000);
 
  }
 
  }

Latest revision as of 11:52, 10 August 2022

/*
 * D1 read data
 * 
 *
 * 
 */

void setup() {
  pinMode(D1,INPUT);
  // initialize serial communications at 9600 bps
  Serial.begin(9600);
}

void loop() {
  in = digitalRead(D1); 
  Serial.println(in); 
  Serial.println("\n"); 
  delay(1000);
}