A lens device includes a control unit, an objective lens, an image sensor,
a light source, a detecting unit, and a tube assembly. The tube assembly
includes a guide barrel, an outer tube, and a lens holder. The guide
barrel is disposed on the control unit. The outer tube includes a tube
body that is rotatably sleeve don the guide barrel, and a guiding
portion. The lens holder includes a holder body having a set of
projections driven by the guiding portion. The image sensor is
electrically coupled to the control unit. The objective lens is optically
aligned with the image sensor. The light source is coupled electrically
to the control unit. The detecting unit generates a detector output
indicating angular orientation of the outer tube. The control unit is
responsive to the detector output to control intensity of light outputted
by the light source.