1. A method of detecting information transmitted by a light source with an image sensor of a mobile device by detecting a pattern of light pulses produced by the light source, the method comprising: capturing on the image sensor an image in which different portions of the image sensor are exposed at different points in time; detecting patterns that include a first set of image features captured when the light source is in a first state of illumination and a second set of image features captured when the light source is in a second state of illumination; measuring a feature of the first set of image features; decoding information encoded in the pattern of light pulses produced by the light source captured in the image based on the measured feature to obtain an identification code that identifies the light source producing the pattern of light pulses; and sending the identification code from the mobile device to a server to obtain information that allows the mobile device to locate itself indoors.