I am having problems not knowing how to wire a sensor, or a phototransistor to analog imput to give me a signal which I would use to play a tune from a speaker. I already have a program which allows me to play that tune, and I have to press a button to play it again. Instead, I would like to get a signal from a phototransistor or proximity sensor that would work same as pressing that button.
I am, however having problems wiring it and also in writting a right program. I already searched on Google. I can't seem to find a right program for it to work.
I wired it like it says on Google, but it doesen't work. If I could at least turn ON and OFF a LED diode just by phototransistor. What should my program look like?