led

Okay so here is what I'm trying to do.

I want to control how long an led blinks and when it blinks with a pot and a photo transistor. The pot will control how long and the pt will tell it when to blink.

I can go into more detail when I get home from work. Lol
thanks

You won't do it with a phototransistor - or not very well, anyway. You really want an LDR - Light Dependent Resistor (also known as Cadmium Sulphide Cell) wired in a resistive divider. A phototransistor only has a very tiny area where the output is variable - it's mainly seen as ON or OFF.

Then, something like:

delay(analogRead(0));
digitalWrite(13,HIGH);
delay(analogRead(1));
digitalWrite(13,LOW);

with the LDR on A0 and the pot on A1 should give the desired results.

I want to control how long an led blinks and when it blinks with a pot and a photo transistor.

More detail needed here please.

Look at the blink without delay sketch to see how to blink an LED correctly.

Or do you mean you want it to wait until the PT goes ON and then do one blink?

majenko:
Or do you mean you want it to wait until the PT goes ON and then do one blink?

yeah. That's all the pt needs to do. I want the led to blink every 4 times the pt senses light.