Heres my updated code. I think its very close to working I just need to figure out this map function. Right now the led is staying high because I dont know what to put in for the second delay. Im sure Im missing something very simple here.
int sensorPin = A3; // select the input pin for the potentiometer
int ledPin = 13; // select the pin for the LED
int sensorValue = 0; // variable to store the value coming from the sensor
int Val = analogRead(sensorPin);
int outVal = map(Val, 0, 1023, 0, 30);
void setup() {
// declare the ledPin as an OUTPUT:
pinMode(ledPin, OUTPUT);
}
void loop() {
// read the value from the sensor:
sensorValue = analogRead(sensorPin);
// turn the ledPin on
digitalWrite(ledPin, HIGH);
// stop the program for <sensorValue> milliseconds:
delay(1000);
// turn the ledPin off:
digitalWrite(ledPin, LOW);
// stop the program for for <sensorValue> milliseconds:
delay(Val);
}