Content of the invention
It is an object of the invention to provide a kind of control method of led night-light of induced environment and device, around sensing
Environmental colors and change led night-light glow color, thus increasing soft degree, to reach the coordination with surrounding.
For achieving the above object, the invention provides following scheme:
A kind of control method of the led night-light of induced environment, methods described includes:
Obtain the first distance value of described led night-light surrounding objects and described led night-light;
By described first distance value sequence;
According to ranking results screening less than described first distance value of setting value, obtain second distance value;
Obtain the color of the corresponding object of described second distance value;
Matched colors according to the color of the corresponding object of described second distance value, obtained result of matching colors;
Described color matching result is sent to light emitting module, described light emitting module is used for controlling described led night-light to light.
Optionally, the described led night-light surrounding objects of described acquisition are specifically included with the first distance value of described led night-light:
Obtain the distance value of the object faced by cubical six faces centered on described led night-light and described led night-light.
Optionally, described described first distance value sorts specifically includes: the mode according to ascending order or descending is arranged
Sequence.
Optionally, described screening specifically includes less than described first distance value of setting value:
For ranking results d1<d2<d3<...<dn, d1Represent the distance value of led night-light described in first object distance, d2
Represent the distance value of led night-light described in second object distance, d3Represent the distance of the 3rd led night-light described in object distance
Value, dnRepresent the distance value of led night-light described in n-th object distance;
Work as d3With d2Distance value difference be less than setting value when, then select d1、d2、d3, obtain second distance value;
Work as d3With d2Distance value difference be more than setting value when, then select d1、d2, obtain second distance value.
Optionally, the described color according to the corresponding object of described second distance value carries out color matching and specifically includes:
Formula is adopted to the color of the corresponding object of described second distance value
J >=2 are carried out linearly
Combination, wherein l is the color after being matched colors according to the color of the corresponding object of described second distance value, that is, the color matching knot obtaining
Really, d1For the corresponding distance value of first object, x1For the corresponding color of first object, d2For second object corresponding away from
From value, x2For the corresponding color of second object, djFor the corresponding distance value of j-th object, xjFor the corresponding face of j-th object
Color, j is the number of distance value in described second distance value.
Optionally, the described color according to the corresponding object of described second distance value carries out color matching and specifically includes:
Formula is adopted according to the color of the corresponding object of described second distance value
J >=2 are carried out linearly
Combination, wherein l is the color after being matched colors according to the color of the corresponding object of described second distance value, d1For first object
Corresponding distance value, x1For the corresponding color of first object, d2For the corresponding distance value of second object, x2For second thing
The corresponding color of body, djFor the corresponding distance value of j-th object, xjFor the corresponding color of j-th object, j is described second distance
The number of distance value in value;
Using formula l=c1r+c2g+c3B carries out tricolor color matching, determines the color matching ratio system of each primary colours in three primary colours
Number, wherein l is the color after being matched colors according to the color of the corresponding object of described second distance value, and r represents red, c1For red
The color matching proportionality coefficient of color, g represents green, c2For green color matching proportionality coefficient, b represents blue, c3For blue color matching ratio
Coefficient.
A kind of led night-light device of induced environment, described device includes:
Apart from acquisition module, for obtaining the first distance value of described led night-light surrounding objects and described led night-light;
Distance-taxis module, for sorting described first distance value;
Apart from screening module, obtain second for according to ranking results screening less than described first distance value of setting value
Distance value;
Color acquisition module, for obtaining the color of the corresponding object of described second distance value;
Color matching module, for being matched colors according to the color of the corresponding object of described second distance value, obtains result of matching colors;
Color matching result sending module, for sending described color matching result to light emitting module, described light emitting module is used for controlling
Make described led night-light to light.
Optionally, described color matching module specifically includes:
Computing unit, described computing unit is used for adopting formula to the color of the corresponding object of described second distance valueJ >=2 carry out linear combination, obtain
To color matching result, wherein l is the color after being matched colors according to the color of the corresponding object of described second distance value, that is, obtain
Color matching result, d1For the corresponding distance value of first object, x1For the corresponding color of first object, d2For second object pair
The distance value answered, x2For the corresponding color of second object, djFor the corresponding distance value of j-th object, xjFor j-th object pair
The color answered, j is the number of distance value in described second distance value.
Optionally, described color matching module specifically includes:
Computing unit, described computing unit is used for adopting formula according to the color of the corresponding object of described second distance valueJ >=2 carry out linear combination, its
Middle l is the color after being matched colors according to the color of the corresponding object of described second distance value, d1Corresponding for first object
Distance value, x1For the corresponding color of first object, d2For the corresponding distance value of second object, x2Correspond to for second object
Color, djFor the corresponding distance value of j-th object, xjFor the corresponding color of j-th object, j is described second distance value middle-range
Number from value;
Tricolor color matching unit, described tricolor color matching unit is used for using formula l=c1r+c2g+c3B carries out three primary colours
Color matching, determines the color matching proportionality coefficient of each primary colours in three primary colours, wherein l is according to the corresponding object of described second distance value
Color matched colors after color, r represents red, c1For red color matching proportionality coefficient, g represents green, c2For green color matching
Proportionality coefficient, b represents blue, c3For blue color matching proportionality coefficient.
The specific embodiment being provided according to the present invention, the invention discloses following technique effect:
Led night-light can around automatic identification orientation color, change led night-light by sensing ambient color and light
Color, thus increasing soft degree so that led night-light glow color is coordinated with ambient color, globality is strong.
Specific embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete
Site preparation description is it is clear that described embodiment is only a part of embodiment of the present invention, rather than whole embodiments.It is based on
Embodiment in the present invention, it is every other that those of ordinary skill in the art are obtained under the premise of not making creative work
Embodiment, broadly falls into the scope of protection of the invention.
It is an object of the invention to provide a kind of control method of led night-light of induced environment and device, around sensing
Environmental colors and change led night-light glow color, thus increasing soft degree, to reach the coordination with surrounding.
Understandable for enabling the above objects, features and advantages of the present invention to become apparent from, below in conjunction with the accompanying drawings and specifically real
The present invention is further detailed explanation to apply mode.
Fig. 1 is the control method flow chart of the led night-light of induced environment of the present invention.As shown in figure 1, methods described includes:
Step 101: obtain the distance between surrounding objects and led night-light value, surrounding objects can be to be with led night-light
The object in the orientation faced by cubical six faces of the heart, that is, up and down before and after six orientation object, if only getting 2
Object or the distance value of 3 objects, then the distance value in other orientation be designated as infinity.
Obtaining distance value detailed process can be to adopt range sensor, by reflecting especially short light pulse, measure this
Light pulse is from being transmitted into the time interval being reflected by surrounding objects, and then the distance between calculates with surrounding, altogether
Measure the air line distance at the object distance led night-light center in six orientation all around up and down, obtain 6 distance values.If same
Have two objects before and after orientation, then the distance value that this orientation obtains be before apart from the near object of led night-light and led night-light away from
From value, because after light pulse being reflected apart from led night-light near object, after object i.e. apart from the remote object of led night-light then not
Light pulse can be received, therefore also would not produce reflection.
The sequencing obtaining six azran values can be manually set or by the built-in fixation of led night-light
Sequentially.The distance value obtaining can also be the distance value more than six orientation or less than six orientation.
Step 102: the distance value obtaining is ranked up, the rule of sequence can be for from small to large or from big
To little.
Step 103: according to ranking results, screening is less than the distance value of setpoint distance value.
The distance value setting can be concrete numerical value, can set suitable distance according to the size of night-light local environment
Value, then the object distance value being less than this setpoint distance value is then the selection result.
The distance value setting can also be the rule setting, and the rule of setting can be: for ranking results d1<d2<d3
<...<dn, d1Represent the distance value of led night-light described in first object distance, d2Represent led night described in second object distance
The distance value of lamp, d3Represent the distance value of the 3rd led night-light described in object distance, dnRepresent led described in n-th object distance
The distance value of night-light;
Work as d3With d2Distance value difference be less than setting value when (such as setting value can be d26 times and more than), then select
d1、d2、d3, as the selection result;This situation can correspond to led night-light and is positioned over the head of a bed and near two face walls;
Work as d3With d2Distance value difference be more than setting value when, then select d1、d2, as the selection result, this situation is permissible
It is positioned over the head of a bed corresponding to led night-light and near a face wall.Above both situations are that modal situation placed by night-light.
Step 104: the corresponding object color of distance value in the selection result is obtained according to the selection result.Obtain the process of color
Color sensor can be adopted, by being compared the reference color of the object color receiving and storage inside, work as reception
To color match in certain range of error with reference color when, output receive color result, will output color
Result and corresponding distance value are sent to color matching module.
Step 105: matched colors according to the color receiving and distance value, obtain result of matching colors.Match color procedure can be: adopts
Use formulaJ >=2 carry out linear combination,
Wherein l be the object according to described reception color matched colors after color, that is, the color matching result obtaining, d1For first thing
The corresponding distance value of body, x1For the corresponding color of first object, d2For the corresponding distance value of second object, x2For second
The corresponding color of object, djFor the corresponding distance value of j-th object, xjFor the corresponding color of j-th object, j be described second away from
The number of distance value in value, in the present embodiment, j value is 2 or 3.
Step 106: result l of matching colors sends to light emitting module, and light emitting module controls led night-light to light.Control led night-light
Luminescence process can be: color matching result l according to step 105 adopts formula l=c1r+c2g+c3B carries out tricolor color matching, determines
The color matching proportionality coefficient of each primary colours in three primary colours, wherein r represents red, c1For red color matching proportionality coefficient, g represents green
Color, c2For green color matching proportionality coefficient, b represents blue, c3For blue color matching proportionality coefficient.According in the three primary colours obtaining
The color matching proportionality coefficient of each primary colours controls led night-light to light.
During above-mentioned realization, the match color procedure of step 105 can also be: adopts formula
J >=2 are carried out linearly
Combination, wherein l is the color after being matched colors according to the color of the object receiving, and d1 is the corresponding distance value of first object,
x1For the corresponding color of first object, d2For the corresponding distance value of second object, x2For the corresponding color of second object,
djFor the corresponding distance value of j-th object, xjFor the corresponding color of j-th object, j is distance value in described second distance value
Number, in the present embodiment, j value is 2 or 3;
Using formula l=c1r+c2g+c3B carries out tricolor color matching, determines the color matching ratio system of each primary colours in three primary colours
Number, wherein l is the color after being matched colors according to the color of the corresponding object of described second distance value, and r represents red, c1For red
The color matching proportionality coefficient of color, g represents green, c2For green color matching proportionality coefficient, b represents blue, c3For blue color matching ratio
Coefficient.
Then step 106 is to send the color matching proportionality coefficient of each primary colours in three primary colours to light emitting module, light emitting module root
Led night-light is controlled to light according to the color matching proportionality coefficient receiving.
Fig. 2 is the led night-light structure drawing of device of induced environment of the present invention.As shown in Fig. 2 described device includes:
Apart from acquisition module 201, for obtaining the distance value of led night-light surrounding objects and led night-light;Surrounding objects are permissible
Be the object in the orientation faced by cubical six faces centered on led night-light, that is, up and down before and after six orientation thing
Body.
Can be range sensor apart from acquisition module 201, by reflecting especially short light pulse, measure this light pulse from
The distance between it is transmitted into the time interval being reflected by surrounding objects, and then calculate with surrounding, measure altogether up and down
The air line distance at the object distance led night-light center in six orientation all around, obtains 6 distance values.The distance value obtaining
It can be the distance value more than six orientation or less than six orientation.
Distance-taxis module 202, for the distance value sequence that will obtain, distance-taxis module 202 can be ascending sort
Module or descending sort module;
Apart from screening module 203, for being less than the distance value of setting value according to ranking results screening.Rule according to screening
Result that difference filters out is different, and screening rule may is that the distance value that sets as concrete numerical value, can according to residing for night-light ring
The size in border sets suitable distance value, then the object distance value being less than this setpoint distance value is then the selection result.
The distance value setting can also be the rule setting, and the rule of setting can be: for ranking results d1<d2<d3
<...<dn, d1Represent the distance value of led night-light described in first object distance, d2Represent led night described in second object distance
The distance value of lamp, d3Represent the distance value of the 3rd led night-light described in object distance, dnRepresent led described in n-th object distance
The distance value of night-light;
Work as d3With d2Distance value difference be less than setting value when (such as setting value can be d26 times and more than), then select
d1、d2、d3, as the selection result;This situation can correspond to led night-light and is positioned over the head of a bed and near two face walls;
Work as d3With d2Distance value difference be more than setting value when, then select d1、d2, as the selection result, this situation is permissible
It is positioned over the head of a bed corresponding to led night-light and near a face wall.Above both situations are that modal situation placed by night-light.
Color acquisition module 204, for obtaining the color of the corresponding object of distance value after screening.Color acquisition module
204 can adopt color sensor, and operation principle is by entering the reference color of the object color receiving and storage inside
Row compares, when the color receiving is matched in certain range of error with reference color, the color result that output receives,
The color result of output and corresponding distance value are sent to color matching module.
Color matching module 205, for being matched colors according to the distance value of the color receiving and corresponding object, obtains color matching knot
Really, formula can be adopted
J >=2 are carried out linearly
Combination, wherein l be the object according to described reception color matched colors after color, that is, the color matching result obtaining, d1For
The corresponding distance value of one object, x1For the corresponding color of first object, d2For the corresponding distance value of second object, x2For
The corresponding color of second object, djFor the corresponding distance value of j-th object, xjFor the corresponding color of j-th object.
By matching colors, result sending module 206 result l of matching colors sends to light emitting module 207, and light emitting module 207 controls
Led night-light lights.Control led night-light luminescence process can be: color matching result l according to step 105 adopts formula l=c1r+c2g
+c3B carries out tricolor color matching, determines the color matching proportionality coefficient of each primary colours in three primary colours, and wherein r represents red, c1For red
Color matching proportionality coefficient, g represents green, c2For green color matching proportionality coefficient, b represents blue, c3For blue color matching ratio system
Number.Color matching proportionality coefficient according to each primary colours in the three primary colours obtaining controls led night-light to light.
As another embodiment, the match color procedure of module 205 of matching colors can also be: adopts formula
J >=2 are carried out linearly
Group
Close, wherein l is the color after being matched colors according to the color of the object receiving, d1 be first object corresponding away from
From value, x1For the corresponding color of first object, d2For the corresponding distance value of second object, x2Corresponding for second object
Color, djFor the corresponding distance value of j-th object, xjFor the corresponding color of j-th object, j is distance in described second distance value
The number of value, in the present embodiment, j value is 2 or 3;
Using formula l=c1r+c2g+c3B carries out tricolor color matching, determines the color matching ratio system of each primary colours in three primary colours
Number, wherein l is the color after being matched colors according to the color of the corresponding object of described second distance value, and r represents red, c1For red
The color matching proportionality coefficient of color, g represents green, c2For green color matching proportionality coefficient, b represents blue, c3For blue color matching ratio
Coefficient.
By matching colors, result sending module 206 sends the color matching proportionality coefficient of each primary colours in three primary colours to light emitting module
207, light emitting module 207 lights the integrated led of red-green-blue according to the color matching proportionality coefficient receiving, and controls led night-light to light.
In this specification, each embodiment is described by the way of going forward one by one, and what each embodiment stressed is and other
The difference of embodiment, between each embodiment identical similar portion mutually referring to.For system disclosed in embodiment
For, because it corresponds to the method disclosed in Example, so description is fairly simple, say referring to method part in place of correlation
Bright.
Specific case used herein is set forth to the principle of the present invention and embodiment, the saying of above example
Bright it is only intended to help and understands the method for the present invention and its core concept;Simultaneously for one of ordinary skill in the art, foundation
The thought of the present invention, all will change in specific embodiments and applications.In sum, this specification content is not
It is interpreted as limitation of the present invention.