Using 2 potentiometers to control a LED and a button to print

Hi there. I'm an Arduino newbie, and I've been having lots of trouble when it comes to coding.
Right now, I'm tryin to build a stroboscope with my Arduino UNO. I want to control the delay() using two potentiometers, one for whole numbers and one for decimals.
Additionally, I want to use a button to print the current rps.

So far, I've managed to somehow control the HIGH and LOW time, but my LED isn't as bright as it should be. I have my button already setup, but I don't know how to code it.
I attach my code so far.

int pinLED = 12;
int sensorP1 = A0;
int sensorP2 = A1;

void setup() {
pinMode(pinLED, OUTPUT);

void loop() {
int valueP1 = analogRead(sensorP1);
int valueP2 = analogRead(sensorP2);
int timeP1 = map(valueP1, 0, 1023, 1000, 5);
float timeP2 = map(valueP2, 0, 1023, 100, 5);
float time_P2 = (timeP2/10);
float timeT = timeP1 + time_P2;
if(500/timeT==0) Serial.print("0.5");
else Serial.print((500/timeT));
Serial.println(" rps");

digitalWrite(pinLED, HIGH);
digitalWrite(pinLED, LOW);


What's making my LED dim?
How do I add the button?

The LED is dim because it is switched ON for timeT microseconds and then it is OFF for 1000 times as long (timeT milliseconds). It's a wonder you can see anything at all.


I fixed it and it worked much better, thank you!