A camera module and a portable electronic device using same are provided. The camera module can be rotated to align with a first camera window and a first aperture in the front of the portable electronic device or a second camera window and second aperture in the rear of the portable electronic device.