Abstract:
An electronic device includes a display unit, a volume control unit, a motion sensor, and a processing unit. The motion sensor is configured to sense the movements of the electronic device rotated around predetermined axes. The processing unit is configured to rotate a currently displayed image a predetermined degree toward a predetermined direction, control the display unit to flip pages, and control the volume adjusting unit to adjust the volume of an opened audio file if the rotation angle of the electronic device rotated around the predetermined axes reaches predetermined angles correspondingly. A related method is also provided.

Description:
BACKGROUND 
       [0001]    1. Technical Field 
         [0002]    The present disclosure relates to electronic devices and methods and, particularly, to an electronic device with motion sensor function and a method for executing predetermined functions based on the movement of the electronic device. 
         [0003]    2. Description of the Related Art 
         [0004]    For small-sized electronic devices, it is difficult for users to press keys and/or touch a touch screen to input information correctly to execute functions by the devices. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0005]    The components of the drawings are not necessarily drawn to scale, the emphasis instead being placed upon clearly illustrating the principles of an electronic device with motion sensor functions and a method for executing predetermined functions based on the movement of the electronic device. Moreover, in the drawings, like reference numerals designate corresponding parts throughout multiple views. 
           [0006]      FIG. 1  is a block diagram of an electronic device in accordance with an exemplary embodiment. 
           [0007]      FIG. 2  is a schematic view showing that the electronic device is rotated around a first axis. 
           [0008]      FIG. 3  is a schematic view showing that the electronic device is rotated around a second axis and a third axis. 
           [0009]      FIG. 4  is a flowchart of a method for executing predetermined functions based on movement of the electronic device of  FIG. 1  in accordance with an exemplary embodiment. 
       
    
    
     DETAILED DESCRIPTION 
       [0010]    Referring to  FIG. 1 , an electronic device  100  in accordance with an exemplary embodiment is illustrated. The electronic device  100  includes an input unit  10 , a storage unit  20 , a volume adjusting unit  30 , a display unit  40 , a motion sensor  50 , and a processing unit  60 . The electronic device  100  may be a device such as a mobile phone, an E-book, or an audio player. 
         [0011]    The storage unit  20  stores multimedia files. 
         [0012]    The input unit  10  is configured to generate signals for controlling the operation of the electronic device  100  in response to user input. 
         [0013]    The volume adjusting unit  30  is configured to adjust the volume of an opened audio file in response to user input. 
         [0014]    The display unit  40  is configured to display information. 
         [0015]    Referring to  FIGS. 2 and 3 , the motion sensor  50  senses the movement of the electronic device  100  according to a predetermined coordinate system. In this embodiment, the predetermined coordinate system is a 3D coordinate system, and the longitudinal direction of the electronic device  100  is the X axis, the wide direction is the Y axis, and the height direction is the Z axis. The electronic device  100  can rotate around three axes. A first axis  101  is perpendicular to XOY plane, a second axis  102  is parallel to the Y axis, and a third axis  103  is parallel to the X axis. In this embodiment, the motion sensor  50  may include an accelerometer and/or a gyroscope. 
         [0016]    The processing unit  60  determines which of the three axes the electronic device  100  is rotated around and whether the rotation angle of the electronic device  100  reaches a predetermined angle based on the sensed movement, and executes a predetermined function if the angle reaches the predetermined angle. 
         [0017]    In this embodiment, the processing unit  60  executes a first function if the rotation angle of the electronic device  100  is rotated around the first axis  101  to reach a first predetermined angle. For instance, the processing unit  60  rotates a currently displayed image a predetermined degree, such as 90 degrees, toward a predetermined direction, such as opposite to the rotation direction of the electronic device  100 . 
         [0018]    The processing unit  60  executes a second function if the rotation angle of the electronic device  100  is rotated around the second axis  102  clockwise or counterclockwise to reach a second predetermined angle. then executes a third function if the rotation angle of the electronic device  100  is rotated around the third axis  103  clockwise or counterclockwise to reach a third predetermined angle. In this embodiment, the third predetermined angle is larger than the second predetermined angle. The processing unit  60  flips a single page of a currently displayed file forward or backward if the rotation angle of the electronic device  100  is rotated around the second axis  102  to reach the second predetermined angle. The processing unit  60  flips multiple pages of the currently displayed file forward or backward if the rotation angle of the electronic device  100  is rotated around the second axis  102  to reach the third predetermined angle. 
         [0019]    The processing unit  60  executes a fourth function if the rotation angle of the electronic device  100  is rotated around the third axis  103  clockwise or counterclockwise to reach a fourth predetermined angle. Then executes a fifth function if the rotation angle of the electronic device  100  is rotated around the third axis  103  clockwise or counterclockwise to reach a fifth predetermined angle. In this embodiment, the fifth predetermined angle is greater than the fourth predetermined angle. The processing unit  60  controls the volume adjusting unit  30  to decrease or increase a unit of the volume of a currently opened multimedia file if the rotation angle of the electronic device  100  is rotated around the third axis  103  clockwise or counterclockwise to reach the fourth predetermined angle. The processing unit  60  controls the volume adjusting unit  30  to continuously decrease or increase the volume of the currently opened multimedia file if the rotation angle of the electronic device  100  is rotated around the third axis  103  clockwise or counterclockwise to reach the fifth predetermined angle. 
         [0020]    Referring to  FIG. 4 , a method for executing predetermined functions based on movement of the electronic device in accordance with an exemplary embodiment. 
         [0021]    In step S 201 , the motion sensor  50  senses the movement of the electronic device  100  according to a predetermined coordinate system. In this embodiment, the predetermined coordinate system is a 3D coordinate system OXYZ, and the longitudinal direction of the electronic device  100  is the X axis, the wide direction is the Y axis, and the height direction is the Z axis. The electronic device  100  can be rotated around three axes. A first axis  101  is perpendicular to XOY plane, a second axis  102  is parallel to the Y axis, and a third axis  103  is parallel to the X axis. 
         [0022]    In step S 202 , the processing unit  60  determines which one of three axes of the electronic device  100  is rotated around according to the sensed movement. 
         [0023]    In step S 203 , the processing unit  60  determines whether the rotation angle of the electronic device  100  is rotated around the determined axis to reach a predetermined angle based on the sensed movement. 
         [0024]    In step S 204 , the processing unit  60  executes a predetermined function if the angle reaches the predetermined angle. 
         [0025]    If the processing unit  60  determines the rotation angle of the electronic device  100  is rotated around the first axis  101  to reach a first predetermined angle, the processing unit  60  rotates a currently displayed image a predetermined degree, such as 90 degrees, toward a predetermined direction, such as opposite to the rotation direction of the electronic device  100 . If the rotation angle of the electronic device  100  is rotated around the second axis  102  to reach a second predetermined angle, the processing unit  60  flips a single page of a currently displayed file forward or backward. If the rotation angle of the electronic device  100  is rotated around the second axis  102  to reach, a third predetermined angle, the processing unit  60  flips multiple pages of the currently displayed file forward or backward. If the rotation angle of the electronic device  100  is rotated around the third axis  103  clockwise or counterclockwise to reach a fourth predetermined angle, the processing unit  60  controls the volume adjusting unit  30  to decrease or increase a unit of the volume of a currently opened multimedia file. If the rotation angle of the electronic device  100  is rotated around the third axis  103  clockwise or counterclockwise to reach a fifth predetermined angle, the processing unit  60  controls the volume adjusting unit  30  to continuously decrease or increase the volume of the currently opened multimedia file. 
         [0026]    Although the present disclosure has been specifically described on the basis of the exemplary embodiment thereof, the disclosure is not to be construed as being limited thereto. Various changes or modifications may be made to the embodiment without departing from the scope and spirit of the disclosure.