Devices & Components
ESP8266 ESP-12E
5 mm LED: Red
Jumper wires (generic)
Resistor 10k ohm
Switch Actuator, Head for spring return push-button
USB-A to Mini-USB Cable
Breadboard (generic)
Project description
Code
Code
c_cpp
Here is the project code.
1 2#include <ESP8266WiFi.h> 3 4void setup() { 5// put your setup code here, to run once: 6pinMode(D0,INPUT); 7pinMode(D1,OUTPUT); 8} 9 10void loop() { 11// put your main code here, to run repeatedly: 12int button=digitalRead(D0); 13if(button==1){ 14digitalWrite(D1,LOW); 15delay(100); 16} 17else{ 18digitalWrite(D1,HIGH); 19delay(100); 20} 21} 22
Downloadable files
circuit diagram
Here is the project circuit.
circuit diagram

circuit diagram
Here is the project circuit.
circuit diagram

Comments
Only logged in users can leave comments