Advertisement
hwthinker

NodeMCU V3 HelloWorld

Dec 28th, 2018
282
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. #define LED_BUILTIN 2 //D4
  2.  
  3. void setup() {
  4. pinMode(LED_BUILTIN, OUTPUT); // Initialize the LED_BUILTIN pin as an output
  5. // initialize both serial ports:
  6. Serial.begin(9600);
  7. }
  8.  
  9. // the loop function runs over and over again forever
  10. void loop() {
  11. digitalWrite(LED_BUILTIN, LOW); // Turn the LED on (Note that LOW is the voltage level
  12. // but actually the LED is on; this is because
  13. // it is acive low on the ESP-01)
  14. delay(100); // Wait for a second
  15. digitalWrite(LED_BUILTIN, HIGH); // Turn the LED off by making the voltage HIGH
  16. delay(1000); // Wait for two seconds (to demonstrate the active low LED)
  17. Serial.println("Hello from HwThinker");
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement