main.c 706 B

1234567891011121314151617181920212223242526272829303132
  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. }