Target device motion state control method based on smart mobile phoneTechnical field
The present invention relates to a kind of target device motion state control method, especially relate to a kind of target device motion state control method based on smart mobile phone.
Background technology
Nowadays, smart mobile phone applies to huge numbers of families, and Bluetooth communication is also a kind of widely used communication means.By reading the state of acceleration transducer of smart mobile phone inside, and carry out data processing, corresponding fill order is sent to target device by the bluetooth of smart mobile phone self, it is carried out to the control of motion state.This can make target device motion state simplify control effectively.
Summary of the invention
Object of the present invention is exactly to provide a kind of target device motion state control method based on smart mobile phone in order to overcome the defect that above-mentioned prior art exists.
Object of the present invention can be achieved through the following technical solutions:
A target device motion state control method based on smart mobile phone, is characterized in that, comprises the following steps:
1) open smart mobile phone bluetooth module;
2) start application program;
3) search target device;
4) be connected with target device;
5) Gravity accelerometer of startup smart mobile phone;
6) smart mobile phone judges that whether the state of Gravity accelerometer changes, and if yes, performs step 7), otherwise, continue execution step 6);
7) according to the motion state of the state value control target device of Gravity accelerometer.
In described smart mobile phone, be provided with the motion state tables of data that Gravity accelerometer state value is corresponding with target device.
Described smart mobile phone is by bluetooth module and target device wireless connections.
Compared with prior art, the present invention has the advantages that smart mobile phone Gravity accelerometer and bluetooth equipment to be combined closely and apply to change target device motion state, and this will make target device motion control more simplify.
Accompanying drawing explanation
Fig. 1 is flow chart of the present invention.
Embodiment
Below in conjunction with the drawings and specific embodiments, the present invention is described in detail.
Embodiment
As shown in Figure 1, a kind of target device motion state control method based on smart mobile phone, comprises the following steps:
1) open smart mobile phone bluetooth module;
2) start application program;
3) search target device;
4) be connected with target device;
5) Gravity accelerometer of startup smart mobile phone;
6) smart mobile phone judges that whether the state of Gravity accelerometer changes, and if yes, performs step 7), otherwise, continue execution step 6);
7) state value of Gravity accelerometer is converted to corresponding control command by smart mobile phone, communicates by bluetooth equipment and target device, and control command is sent to target device, and target device receives after instruction, carries out motion accordingly.
In described smart mobile phone, be provided with the motion state tables of data that Gravity accelerometer state value is corresponding with target device.Described smart mobile phone is by bluetooth module and target device wireless connections.