Using DS1307 timer to turn off ultrasonic sensor or LED's coding help.

Greetings! I am building an ultrasonic garage parking aid with an arduino uno, ultrasonic sensor. leds and DS1307 timer. I have the sensor and leds working but I have two issues. The first is the leds don’t stay on constantly, they randomly blink when updating the position of the vehicle. Is there anyway I can get them to stay on constantly when driving in? Second, I would like the leds to turn off after 5 minutes of the car being parked or the ultrasonic not sensing motion. I am concerned about the ultrasonic picking up stray echoes and turning the leds back on at random. I have been doing some research and I believe i needed the ds1307 timer to do this but I do not know how to approach coding it. Any help would be greatly appreciated.

// We're including some Libraries, "Ultrasonic.h" and "FastLED.h"
// FastLED.h gives us the ability to addres the WS2812 LEDs
// "Ultrasonic.h" allows us to trigger and read the ultrasonic sensor
#include "Ultrasonic.h"
#include "FastLED.h"
#include <Wire.h>
#include <Time.h>
#include <TimeLib.h>
#include <RTClib.h>
#include <DS1307RTC.h>



// How many LEDs will you have in your array?
#define NUM_LEDS 26

// Which Digital pin will be used to control the WS2812 lights?
// We'll be using Digital Data Pin #7
#define DATA_PIN 7


// Creates an array with the length set by NUM_LEDS above
// This is the array the library will read to determine how each LED in the strand should be set
CRGB leds[NUM_LEDS];

// Now we're going to initialize the Ultrasonic Sensor
// The sensor itself needs four leads: ground, vcc, trigger, and echo
// This tells the ultrasonic library that the trigger pin is on digital 13
// This also tells the ultrasonic library that the echo pin is on digital 12
Ultrasonic ultrasonic(13, 12);


// This tells the library that there is a strand of NEOPIXELS attached to the Arduino
// that they are connected to the DATA_PIN specified above
// that the library should look at the array called "leds"
// and that there are the number of LEDs in the strand as defined above in "NUM_LEDS"
// It also opens the serial port so we can see the range values
void setup()
{
  FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS);
  Serial.begin(9600);
}

// In our last code example, we used the serial console to report the position of our analog potentiometer.
// This time, we're using it to report the Only used for debugging. This will report the distance of the ultrasonic sensor to an object hard enough to create an echo
void Range_Debug(int x)
{
  Serial.println(x);
  delay(50);
}

void Range_LED(int RangeValue)
{
  // This creates an integer named "LightMap" that remaps a given range of distances, in CM, to the range of leds
  // the map function uses the following values (the number to map, the lower boundary of the current value, the upper boundary of the current value, the lower boundary of the target, the upper boundary of the target)
  // Even though our US sensor was detecting out to 170CM, I'm compressing it so that it will fit better into the LEDs
  // I've made NUM_LEDS the lower boundary of the target, because I want ALL leds to be lit when the range value is lowest.
  int LightMap = map(RangeValue, 60, 300, NUM_LEDS, 0);

  // Resets the LED values
  FastLED.clear();

  // Change led colors based on the value of "RangeValue"
  // Starts with blue, then yellow, then orange, green, then orange, then yellow, then red. 
  for (int led = 0; led < LightMap; led++)
  {
    if (led < (NUM_LEDS * .18))                              leds[led] = CRGB::Blue;
    if (led >= (NUM_LEDS * .18) & led < (NUM_LEDS * .30))    leds[led] = CRGB::Yellow;
    if (led >= (NUM_LEDS * .30) & led < (NUM_LEDS * .42))    leds[led] = CRGB::Orange;
    if (led >= (NUM_LEDS * .42) & led < (NUM_LEDS * .56))    leds[led] = CRGB::Green;
    if (led >= (NUM_LEDS * .56) & led < (NUM_LEDS * .68))    leds[led] = CRGB::Orange;
    if (led >= (NUM_LEDS * .68) & led < (NUM_LEDS * .80))    leds[led] = CRGB::Yellow;
    if (led >= (NUM_LEDS * .80) & led < (NUM_LEDS))          leds[led] = CRGB::Red;
}
  FastLED.setBrightness(30);
  FastLED.show();
}

void loop() {
  // This creates an integer variable called "range", then fills it with the range from the Ultrasonic sensor in centimeters
  int range = (ultrasonic.Ranging(CM));

  // This calls the Range_Debug function and passes it the value of the "range" variable
  // This allows us to see the range values on the serial port monitor
  Range_Debug(range);
  Range_LED(range);
}

No, you don't need an RTC for this. Just the built in timing function millis().

Any suggestions on how to do that? I am still new to the programming bit of it.

and DS1307 timer

A DS1307 is NOT a timer. It is a clock. It is simple, with a clock, to note what time something happened. It is simple to note, on each pass through loop(), what time it is. It is simple to determine whether now minus then is greater than the desired interval. It is simple to take the appropriate action if that is true.

Try something. Observe the results. If the results are not what you expect, post the code, describe the results, and we'll explain why the actual results do not match your expectations.

but I do not know how to approach coding it.

I'm reasonably confident that you are smarter than the Arduino. I'm sure that you can figure out how YOU would do what needs to be done. Translating that into code is pretty simple.