#include <stdio.h>
#include <math.h>
#include "pico/stdlib.h"
#include "./bh1750.h"
#include "./servo.h"
int main() {
stdio_init_all();
servo_init();
init_bh1750();
bh1750_configure();
float min_lux = 1.0f;
float max_lux = 10000.0f;
while (1) {
float lux = read_light();
float target_angle = fabs((lux - min_lux) * 180.0f / (max_lux - min_lux));
servo_sweep(servo_config.current_angle, target_angle);
servo_config.current_angle = target_angle;
sleep_ms(500);
}
return 0;
}