#include "I2C.h"
#include "I2C.c"
#include "DS3231.h"
#include "DS3231.c"
#include <stdio.h>
#include <stdint.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
//#include "LCD1602.h"
//#include "ENCODER.h"
//int8_t h = 0, m = 0, s = 0, s_p = 0;
void app_main() {
printf("Hello, Wokwi!\n");
i2c_master_bus_init();
i2c_dev_init(0x68);
vTaskDelay(pdMS_TO_TICKS(100));
DS3231_set_time(2, 10, 1);
vTaskDelay(pdMS_TO_TICKS(100));
static uint8_t h = 0, m = 0, s = 0, s_p = 0;
//DS3231_get_time(&h, &m, &s);
//printf("%02u:%02u:%02u\n", h, m, s);
while (true) {
DS3231_get_time(&h, &m, &s);
if (s != s_p) {
printf("%02u:%02u:%02u\n", h, m, s);
s_p = s;
}
vTaskDelay(300 / portTICK_PERIOD_MS);
}
}