main.c 966 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #include <stdio.h>
  2. #include "freertos/FreeRTOS.h"
  3. #include "freertos/task.h"
  4. #include "driver/gpio.h"
  5. #include "esp_log.h"
  6. #include <stdbool.h>
  7. #include "sdkconfig.h"
  8. #include "sound.h"
  9. #include "config.h"
  10. #include "fridgeDoor.h"
  11. #include "wifi.h"
  12. #include "mqtt.h"
  13. static void configure_led(void)
  14. {
  15. ESP_LOGI("LED", "Example configured to blink GPIO LED!");
  16. gpio_reset_pin(BLINK_GPIO);
  17. /* Set the GPIO as a push/pull output */
  18. gpio_set_direction(BLINK_GPIO, GPIO_MODE_OUTPUT);
  19. }
  20. void app_main(void)
  21. {
  22. initWifi(); // Init WIFI
  23. //mqtt_init();
  24. /* Configure the peripheral according to the LED type */
  25. configure_led();
  26. //setup_photo_sensor();
  27. //initSound();
  28. while(1) {
  29. gpio_set_level(BLINK_GPIO, 1); // Turn the LED on (1 is high)
  30. vTaskDelay(500 / portTICK_PERIOD_MS);
  31. gpio_set_level(BLINK_GPIO, 0); // Turn the LED off (0 is low)
  32. vTaskDelay(500 / portTICK_PERIOD_MS);
  33. }
  34. }