#include <stdio.h>
#include <unistd.h>
#include "motor.h"

int main() {

  // Simple Control Loop
  while (1) {
    if (!doors_locked()) {
      fprintf(stderr, "*** Alert. Not all doors are closed ***\n");
    } else {
      fprintf(stdout, "All dooors are closed\n");
    }
    fprintf(stdout, "Current engine speed: %d\n", engine_speed());

    usleep(1000*500);

    
    
  }
  
}
