I have a project of which a subsystem is automatic lighting:
To control a led by a photoresistor connected to an analog input of an arduino mega 2560 board, I created this program but when I simulate it on the Proteus isis environment, the voltage detected always remains at 5V even if I change the 'light intensity. And suddenly the led does not light up.
But when I test it with a UNO card it works very well.
I don't know in which level I have a problem is that at the level of the code or the pinout on isis.
Yes, I had seen this problem when I was working with a simulator. There often you have to set the analog pins as inputs into your program for put ON your ADC. It isn't necesary when you upload it to your Arduino but when you are working with a simulator often it could be a mistake.
When you say "photoresistor" do you mean an LDR?
LDRs are OK to a point, but their spectral sensitivity may not always match what you need for a lighting project. I guess you want to system to control light for humans.
This is just a side idea, but I tend to use an ambient light sensor instead of and LDR because they are tuned to match the human vision spectrum.
For example, the TEPT4400 has peak sensitivity of 570nm which closely matches the human eye - hence very suitable for lighting control projects.
Hope this helps.