Control RGB LED Strip with sharp distance sensor

Again take the blink without delay example but this time use the distance sensor to change the time to the next blink instead of making it a fixed time. So when it is time to change the state of the LED (either on or off) you do the change then set the time for the next change. In the blink without delay this is a constant, you want to make it a function of you sensor. You can use a series of if statements if you want. Gather them into a function that returns a value for the next time timer.