To use an LED as light sensor you can use PBP's RCTIME or if you want to use the analog approach try connecting the anode to the input pin and the cathode directly to vss, the following code gives me 0 at dark and ~450 in the light:
(I'm using 5mm Ultra bright Blue LED)Code:Inicio: suma=0 for cont=1 to 10 adcin 3,dato suma=suma+dato pause 100 next cont suma=suma/10 serout transmitir,0,[#suma,10] goto inicio
Regards.
Bookmarks