commit d0fb62af9b80ca2e24ec964f1e066f3c662505d3 Author: Stephen Minakian Date: Tue Jul 8 18:26:54 2025 -0600 first commit diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100755 index 0000000..148668a --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,6 @@ +# The following five lines of boilerplate have to be in your project's +# CMakeLists in this exact order for cmake to work correctly +cmake_minimum_required(VERSION 3.16) + +include($ENV{IDF_PATH}/tools/cmake/project.cmake) +project(maxxfan-controller) diff --git a/main/CMakeLists.txt b/main/CMakeLists.txt new file mode 100755 index 0000000..436a1be --- /dev/null +++ b/main/CMakeLists.txt @@ -0,0 +1,2 @@ +idf_component_register(SRCS "maxxfan-controller.c" + INCLUDE_DIRS ".") diff --git a/main/maxxfan-controller.c b/main/maxxfan-controller.c new file mode 100755 index 0000000..db975ad --- /dev/null +++ b/main/maxxfan-controller.c @@ -0,0 +1,47 @@ +#include +#include "freertos/FreeRTOS.h" +#include "freertos/task.h" +#include "driver/gpio.h" +#include "esp_log.h" + +// Define which GPIO pin to use (most ESP32 boards have LED on GPIO2) +#define LED_PIN GPIO_NUM_13 + +// Tag for logging +static const char* TAG = "BLINK"; + +void app_main(void) +{ + ESP_LOGI(TAG, "Starting blink example!"); + + // Configure the GPIO pin as output + gpio_config_t io_conf = { + .pin_bit_mask = (1ULL << LED_PIN), // Bit mask for the pin + .mode = GPIO_MODE_OUTPUT, // Set as output mode + .pull_up_en = GPIO_PULLUP_DISABLE, // Disable pull-up + .pull_down_en = GPIO_PULLDOWN_DISABLE, // Disable pull-down + .intr_type = GPIO_INTR_DISABLE // Disable interrupt + }; + + // Apply the configuration + gpio_config(&io_conf); + + ESP_LOGI(TAG, "GPIO configured! Starting blink loop..."); + + // Main loop + while(1) { + // Turn LED on + gpio_set_level(LED_PIN, 1); + ESP_LOGI(TAG, "LED ON"); + + // Wait 1 second + vTaskDelay(pdMS_TO_TICKS(1000)); + + // Turn LED off + gpio_set_level(LED_PIN, 0); + ESP_LOGI(TAG, "LED OFF"); + + // Wait 1 second + vTaskDelay(pdMS_TO_TICKS(1000)); + } +} \ No newline at end of file