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.

30 lines
778 B

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. int LED_ONBOARD = 02;
  12. void setup() {
  13. // put your setup code here, to run once:
  14. pinMode(LED_BUILTIN, OUTPUT);
  15. //serial monitor setup
  16. Serial.begin(115200);
  17. }
  18. void loop() {
  19. // put your main code here, to run repeatedly:
  20. Serial.print("ON");
  21. digitalWrite(LED_BUILTIN, HIGH);
  22. delay(500);
  23. // after delay
  24. Serial.print(" - OFF\n");
  25. digitalWrite(LED_BUILTIN, LOW);
  26. delay(500);
  27. }