diff options
Diffstat (limited to 'firmware/src/main')
| -rw-r--r-- | firmware/src/main/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | firmware/src/main/hello_world_main.c | 20 |
2 files changed, 22 insertions, 0 deletions
diff --git a/firmware/src/main/CMakeLists.txt b/firmware/src/main/CMakeLists.txt new file mode 100644 index 0000000..07686dc --- /dev/null +++ b/firmware/src/main/CMakeLists.txt @@ -0,0 +1,2 @@ +idf_component_register(SRCS "hello_world_main.c" + INCLUDE_DIRS "") diff --git a/firmware/src/main/hello_world_main.c b/firmware/src/main/hello_world_main.c new file mode 100644 index 0000000..1222e05 --- /dev/null +++ b/firmware/src/main/hello_world_main.c @@ -0,0 +1,20 @@ +#include "freertos/FreeRTOS.h" +#include "freertos/task.h" +#include "driver/gpio.h" +#include "hal/gpio_types.h" + +#include <stdio.h> + +void app_main(void) +{ + gpio_reset_pin(3); + gpio_set_direction(3, GPIO_MODE_OUTPUT); + while (1) { + printf("Hello world!\n"); + fflush(stdout); + gpio_set_level(3, 1); + vTaskDelay(1000 / portTICK_PERIOD_MS); + gpio_set_level(3, 0); + vTaskDelay(1000 / portTICK_PERIOD_MS); + } +} |
