LED as light sensor