ESP32 basic configuration and hello world
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
764 B

2 years ago
2 years ago
  1. /*
  2. *
  3. * Example code for ESP32-S:
  4. * The code blinks the onboard LED (at D2 in GPIO 02) every 0.500 seconds.
  5. * The code also prints by serial communcation the word "Hello" during the
  6. * ON stage of the LED, and then prints "World" during the OFF.
  7. * Gerardo Marx 19/Jul/2022
  8. */
  9. // this variable is defined in pins_arduino.h for DOIT ESP32 DEVKIT V1
  10. // int LED_BUILTIN = 02;
  11. void setup() {
  12. // put your setup code here, to run once:
  13. pinMode(LED_BUILTIN, OUTPUT);
  14. //serial monitor setup
  15. Serial.begin(115200);
  16. }
  17. void loop() {
  18. // put your main code here, to run repeatedly:
  19. Serial.print("ON");
  20. digitalWrite(LED_BUILTIN, HIGH);
  21. delay(500);
  22. // after delay
  23. Serial.print(" - OFF\n");
  24. digitalWrite(LED_BUILTIN, LOW);
  25. delay(500);
  26. }