Ok I want to be able have my arduino play a tone when it gets a certain darkness. I'm going to use and led as a light sensor. the way it will work is when someone walks in front of an led it will create darkness and at a certain darkness it will play a tone. I need help with the coding part.
its to basically tell me when someone is at my door.
You posted about using an LED as a sensor. That seems like a good place to start. When you have a light level, you can see if it is above or below some value. If it is, do something.
What is going to make the noise? The Arduino itself won't. What will make the noise affects the coding.
Everything you need to know is covered by Jeremy Blum @
Just need to modify his code and schematics!
@PaulS I'm going to use a speaker to generate the noise. I want to have it generate a tone using the tone library once it reaches a certain amount of darkness from someone walking in front of it.
I'm going to use a speaker to generate the noise.
What kind of speaker? Not all speakers can be connected to an Arduino without external hardware. The output from the Arduino pins is typically not enough to drive any real speaker.
its a small computer speaker like a watt or so. I've tried it on the arduino and it works fine.