range finder and LEDs

Do I use a switch statement?

No, you'd use an if/else statement.

What is the best way?

The best way would be for you to define what "throb" means. It appears that what you are after is a non-linear relationship between distance and delay.