Using millis to measure intervals to trigger a digital output

Thanks man! It totally worked. My sensor is a bit buggy though so the project doesn't work the greatest but it does occasionally!