Attiny85 Not triggering IR Led to trip camera shutter

I have a program to trigger my D80 for lightning shots and although it works perfect with my UNO it seems to have a problem with the Attiny. I suspect it may have to do with the microseconds section but I am not sure - any assistance will be appreciated.
The pins used are actually pin 3 for the LDR (physical 2) and pin 0 for the IR Led(physical 5) used the ones in the program to verify on the UNO.

Lightning_Trigger_for_Nikon_attiny_R01_ino.ino (2.78 KB)

Hi retiree

it seems to have a problem with the Attiny

What happens when you run it on the ATtiny?

As an initial guess, any improvement if you change the declaration of the analog pin to this?

int ldrPin = A3;



Hi Ray
Nothing happens. Also note that on the Attiny I use pin 3( physical 2) for the LDR and pin 0 (physical 5) for the IRLed. I forgot to change the pin numbers back before uploading after verifying it again on the Uno.

Thanks I will try that

Something you could try to localise the problem ...

Create a test version of your program that blinks the LED once (on for say 1s) when the LDR trigger event occurs, and change the IR LED for a normal one so you can see it. That would show whether the problem is on the analogRead side or the IR side.

What speed are you running the ATtiny at? Internal clock or external crystal?

And which ATtiny core are you using?

Thanks Ray - that simple change fixed it.

Hackscribble thanks for the reply - I did verify the code using a LED and that triggered even just having it assigned to 3. The IR did not want to work but does now after changing to A3
I am using the the ATtiny 85 at 8MHZ internal