 {
   for (int i = 0; i < average_trials; i = i +1)
   {
+    // For each index of the array, get distance and store distance at that index
     lidar_array[i] = get_distance();
   }
 }

/* arduino_distance
 * Uses VL53L0X Time-of-Flight Lidar sensor for distance measurement
 * Stepper motor rotation
 * Work in progress - Matthew Timmons-Brown
 */

#include <Wire.h>
#include <VL53L0X.h>
#define average_trials 3

VL53L0X sensor;

void setup()
{
  Serial.begin(9600);


void loop()
{
  // Initiliase variables
  int avg;
  int lidar_array[average_trials]; // Create array
  populate_lidar_array(lidar_array); // Pass array into populate_lidar_array function and fill with distance values
  avg = average_lidar_array(lidar_array); // Average array values and store in avg variable
  Serial.print(avg);
  Serial.println();
}
