1. Technical Field
Embodiments of the present disclosure relate to alarm systems and methods, and more particularly to an electronic device and a method of controlling alarm clock function of the electronic device.
2. Description of Related Art
Electronic devices (such as mobile phones) often have an alarm function. Using the alarm function, a user of an electronic device can set an alarm clock to remind himself/herself of something (e.g., awake him/her from sleep) at a specific time. When a current time of the electronic device matches the specified time, the alarm clock is activated, and the user may select to turn off the alarm clock. However, the user may accidentally turn off the alarm clock so that the alarm clock may not ring again. As a result, without the reminder of the alarm clock, the user may forget to do important things in time.
The present disclosure, including the accompanying drawings, is illustrated by way of examples and not by way of limitation. It should be noted that references to “an” or “one” embodiment in this disclosure are not necessarily to the same embodiment, and such references mean “at least one.”
In general, the word “module,” as used hereinafter, refers to logic embodied in hardware or firmware, or to a collection of software instructions, written in a programming language, such as, for example, Java, C, or assembly. One or more software instructions in the modules may be embedded in firmware. It will be appreciated that modules may comprise connected logic units, such as gates and flip-flops, and may comprise programmable units, such as programmable gate arrays or processors. The modules described herein may be implemented as either software and/or hardware modules and may be stored in any type of non-transitory computer-readable storage medium or other computer storage device.
In one embodiment, the G-sensor 10 detects acceleration values of the electronic device 1. The system 11 sets an alarm clock. When a current time of the electronic device 1 matches an alarm time of the alarm clock, the system 11 automatically detects whether a user of the electronic device 1 is awakened according to the acceleration values detected by the G-sensor 10, and activates the alarm clock to wake the user up in response to a determination that the user is not awakened.
The system 11 includes a number of function modules (depicted in
In one embodiment, the G-sensor 10 detects the acceleration values in respect of an X-axis, a Y-axis and a Z-axis. The X-axis is a horizontal axis of the screen 14 of the electronic device 1. The Y-axis is a vertical axis of the screen 14 and the Z-axis is on a line which extends straight up and straight down perpendicularly from a middle of the screen 14.
In step S10, when a current time of the electronic device 1 matches an alarm time of an alarm clock function, the prompt module 110 provides a warning to a user by a preset manner of the alarm clock, and displays a close mode option and a snooze mode option on the screen 14, for the user to select one. The close mode option allows the user to turn off the alarm clock altogether. The snooze mode option provides a warning for the user by the preset manner again after a time interval, such as ten minutes, for example. In one embodiment, the preset manner is a preset ring or a preset vibration of the electronic device 1.
In step S11, the selection of either the close mode option or the snooze mode option is received by the receiving module 111.
In step S12, the receiving module 111 receives X acceleration values of the X-axis, Y acceleration values of the Y-axis, and Z acceleration values of the Z-axis, which are in relation to the electronic device 1 and detected by the G-sensor 10.
In step S13, the determination module 112 determines a first average value of the X acceleration values, a second average value of the Y acceleration values, and a third average value of the Z acceleration values.
In step S14, the determination module 112 determines whether the user is awakened within a first time period (e.g., 5 minutes) by determining if any one of the first average acceleration value, the second average acceleration value, and the third average acceleration value is greater than a predetermined value in the first time period. If the first average acceleration value, or the second average acceleration value, or the third average acceleration value is greater than the predetermined value in the first time period, the determination module 112 determines that the user is awake in the first time period, then step S15 is implemented. If none of the first average acceleration value, the second average acceleration value, or the third average acceleration value are greater than the predetermined value, the determination module 112 determines that the user is still asleep, then step S17 is implemented.
In one embodiment, supposing that in the first predetermined time period, a number N of X acceleration values, a number N of Y acceleration values, and a number N of Z acceleration values are detected by the G-sensor 10. For example, ten X acceleration values, ten Y acceleration values, and ten Z acceleration values may be detected. Then, the first average acceleration value is obtained by dividing a sum of the X acceleration values by N (e.g., N=ten). The second average acceleration value is obtained by dividing a sum of the Y acceleration values by N. The third average acceleration value is obtained by dividing a sum of the Z acceleration values by N.
In step S14, if the determination module 112 determines that the user has been woken or is awake, step S15 is implemented, the determination module 112 determines whether the close mode has been selected. If the selection is the close mode option, the procedure ends. If the selection is the snooze mode option, step S16 is implemented, the execution module 113 terminates the snooze function and notifies the G-sensor 10 to stop detecting acceleration values of the electronic device 1, and the procedure ends.
In step S14, if the determination module 112 determines that the user is not awakened, that is, the user is still asleep, step S17 is implemented, the determination module 112 determines whether the selection is the close mode option. If the selection is the snooze mode option, step S18 is implemented, the execution module 113 continues to implement the snooze function, then the procedure goes to step S20. Otherwise, in step S17, if the selection is the close mode option, step S19 is implemented, the execution module 113 provides a prompt for the user again by the preset manner, then the procedure goes to step S20.
In step 20, the determination module 112 determines whether the user of the electronic device 1 is not awakened by the preset manner within a second time period (e.g. 30 minutes) by determining if all the X acceleration values, the Y acceleration values and the Z acceleration values equal zero in the second time period. If all the X acceleration values, the Y acceleration values and the Z acceleration values in the second predetermined time period equal zero, the determination module 112 determines that the user has not been woken up, then step S21 is implemented, and the execution module 113 sends a message to another electronic device of a preset person, to prompt the preset person to awaken the user of the electronic device 1. Otherwise, if all the X acceleration values, the Y acceleration values and the Z acceleration values in the second predetermined time period do not equal zero, the determination module 112 determines that the user has been woken up, and the procedure ends. In one embodiment, the second time period is more than the first time period.
It should be emphasized that the above-described embodiments of the present disclosure, including any particular embodiments, are merely possible examples of implementations, set forth for a clear understanding of the principles of the disclosure. Many variations and modifications may be made to the above-described embodiment(s) of the disclosure without departing substantially from the spirit and principles of the disclosure. All such modifications and variations are intended to be included herein within the scope of this disclosure and protected by the following claims.
Number | Date | Country | Kind |
---|---|---|---|
102103041 | Jan 2013 | TW | national |