Controlling multiple LEDs using LDRs to turn them on and off

Thanks Sterretje,
The tone function is a throw-away to make the thing beep at passers-by and probably won't be used in that format so that can be discounted. All other "delays" are required by hardware.

Anyway, the ldr/digital modules are glued into position now so I'll code them this morning.
D6

No, delay() is not required by hardware. There is a NewPing library that allows you to use the HC_SR04 without having to wait for its reply.

For the tone, you can use a statemachine in combination with a millis() based timing; no delays required.

But your major problem will happen when you call displayoptions(). Indeed, with the approach of using while loops, you will need interrupts. Get rid of the while loops in there.

No you are indeed wrong - Newping does not quite work correctly and it DOES (if you read newping.h etc have delay() built-in.

Other hardware used in this project also requires delays.

I tried to figure how some members on here get posting levels so very hight - I figured it - you just have to have the last word on every posting. Go on, post the last one ........................... then I'll refute it and you can justify then I'll refute again.

Drop it, I DO NEED TO USE DELAY for various parts of my project.
I have found a way to get my analogue ldr to produce a digital output
Thank you
thank you
thank you.
Have I thanked you enough for your help?
end.
pip pip

Hi, I want to do a similar project, do you have a picture or diagram of your circuit?