Heres my code. As Im just working on getting the delay sorted out Im using and adjustable blink sketch. The period the led is low is adjustable. I put the analogread in the setup because I want it to only happen after resetting the timer. Im pretty sure Im not doing this right because I replaced 255 with 180 for 3 minutes and nothing changed. It still stayed off for same period of time the 255 gave me. Im so close to getting this working! I think this is my last hurdle for the code with this project.
int sensorPin = A5; // 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
void setup() {
// declare the ledPin as an OUTPUT:
pinMode(ledPin, OUTPUT);
sensorValue = analogRead(sensorPin);
int val = analogRead(5);
val = map(val, 0, 1023, 0, 180);
}
void loop() {
// read the value from the sensor:
; // turn the ledPin on
digitalWrite(ledPin, HIGH);
// stop the program for milliseconds:
delay(3000);
// turn the ledPin off:
digitalWrite(ledPin, LOW);
// stop the program for for milliseconds:
delay(sensorValue);
}