Files
gobot/i2c-hub/firmware/i2c-hub-firmware/src/main.cpp
2024-12-29 17:30:22 +01:00

39 lines
683 B
C++

#include <stdio.h>
#include "pico/stdlib.h"
#include "FreeRTOSConfig.h"
#include "FreeRTOS.h"
#include "task.h"
#define LED_PIN 25
void TaskFn(void * args) {
while (true) {
gpio_put(LED_PIN, false);
vTaskDelay(500 / portTICK_PERIOD_MS);
gpio_put(LED_PIN, true);
vTaskDelay(500 / portTICK_PERIOD_MS);
}
}
int main()
{
stdio_init_all();
gpio_init(LED_PIN);
gpio_set_dir(LED_PIN, true);
stdio_init_all();
printf("HelloWorld!\n");
TaskHandle_t taskHandle;
BaseType_t res = xTaskCreate(TaskFn, "UART Task", 128, NULL, 1, &taskHandle);
printf("%d\n");
vTaskStartScheduler();
while(1) {}
}