pulse sensor connected to LED

hi! i'm working on arduino for university. I connected arduino to e pulse sensor and some LED. i want the light not to blink like the heartpulse, but to get more or less intense. if the heartbeat gets faster the light brights up, if it gets slower it gets darker (without blinking or fading). some ideas of which code i could use? thank you a lot