# Finalizing a lustre + real-time application This example implements a more sophisticated controller for the BatCar: - basically, the BatCar follows a black line, by sampling the line-light sensors (left+right, Boolean), and sending commands to the motors (left+right, integers) - Moreover, it samples the distance to a possible obstacle using the ultra-sonic sensor. If the distance is less than a certain amount (~15cm), the BatCat performs a U-turn, and follows the line again in reverse direction - the controller functionality is written in Lustre and given # Folder contents - control.lus (given): implements the expected functionality - control_loop.cpp (to be completed): the setup and loop implementation - control_ext.h (given): the C definition of lustre basic types, suitable for arduino - Makefile (given): extended to handle the compilation of lustre code # Completing the control_loop - As it is, the project compiles (try 'make') but the resulting program does nothing: * all the 'glue' code between lustre and arduino/BatCar is missing - Complete the 'control_loop.cpp' in order to get a functionnal application - Hints: * there are 'TODO' marks in the code, at places where additional code is required * there is no reference manual for BatCar API, but the file 'code/BatCar.h' is self-explaining. * Arduino reference is available online (https://www.arduino.cc/reference/en/), but you can focus on few functions : 'delay()', and 'millis()' # To go further - play with the functionality by modifying the lustre code - add some code to check the WCET (Worst Case Execution Time) of the loop