#include "lab.h"
#include "esp_log.h"
void app_main(void) {
    button_init();
    motor_init();
    motor_set(0,0);
    int64_t stop_at=0;
    bool running=false;
    for(;; ) {
        if(button_pressed()&&!running) {
            motor_set(300,0);
            running=true;
            stop_at=now_ms()+500;
        }
        if(running&&now_ms()>=stop_at) {
            motor_set(0,0);
            running=false;
            ESP_LOGI("motor","stopped");
        }
        vTaskDelay(pdMS_TO_TICKS(10));
    }
}
