CN102772896A - Method for realizing wireless electronic dice game system - Google Patents
Method for realizing wireless electronic dice game system Download PDFInfo
- Publication number
- CN102772896A CN102772896A CN2012102068508A CN201210206850A CN102772896A CN 102772896 A CN102772896 A CN 102772896A CN 2012102068508 A CN2012102068508 A CN 2012102068508A CN 201210206850 A CN201210206850 A CN 201210206850A CN 102772896 A CN102772896 A CN 102772896A
- Authority
- CN
- China
- Prior art keywords
- dice
- usb
- wireless
- wireless adapter
- power consumption
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Abstract
The invention discloses a method for realizing a wireless electronic dice game system. According to the method, a wireless electronic dice, a USB (universal serial bus) wireless adapter, and a PC (personal computer) or a pad are arranged, wherein the wireless electronic dice is an actual dice capable of being tossed; the USB wireless adaptor is a receiver inserted on the PC or the pad. After a user tosses the wireless electronic dice, the wireless electronic dice can detect current point number, the point number is sent to the USB wireless adaptor through an IEEEE802.15.4 wireless network; the USB wireless adaptor sends the point number to a PC user interaction process or a pad user interaction process. The wireless electronic dice and the USB wireless adaptor are communicated by the 802.15.4 network; and the USB wireless adaptor and the PC or the USB wireless adaptor and the pad are communicated by a USB interface. According to the method for realizing the wireless electronic dice game system, the user can toss the actual dice, but other processes of the game are realized in the electronic device PC or the pad.
Description
Technical field
The present invention relates to the wireless Star Network games system that is the basis with IEEE 802.15.4 agreement, the implementation method of particularly a kind of wireless electron dice game system.
Background technology
The recreation that uses dice in the market has two kinds, and a kind of is actual dice, and the user can throwing; And read up counting of one side; Continue recreation then, the user need have other article and use for recreation, does not relate to the use of electronic equipment such as PC, pad during this.Another kind is a simulated dice on PC or pad, and all game process realize on electronic equipment that all the user only needs a PC or pad, do not need other any article.
But for much human, still hoping can the actual dice of throwing, but preferably need not prepare other article, and except the throwing dice, other game process all can be realized on electronic equipment.
Summary of the invention
The purpose of this invention is to provide a kind of method that realizes wireless electron dice game system, this method can make the actual dice of user's throwing, but other processes of recreation all realize on electronic equipment PC or pad.
The concrete technical scheme that realizes the object of the invention is:
The implementation method of a kind of wireless electron dice game system, this method comprises following concrete steps:
A, the wireless electron dice is set
The wireless electron dice is made up of a hollow housing and a circuit board; Circuit board is arranged in the hollow housing; The hollow housing surface is respectively equipped with difference and counts; Circuit board is made up of a low-power consumption microcontroller and an acceleration of gravity sensor that has wireless radio frequency modules, uses the button cell power supply, adopts the I2C interface to communicate between low-power consumption microcontroller and the acceleration of gravity sensor;
B, the USB wireless adapter is set
The USB wireless adapter is made up of a plastic casing and a circuit board; Circuit board is arranged in the plastic casing; Circuit board is made up of a low-power consumption microcontroller and a USB commentaries on classics serial port chip that has wireless radio frequency modules; Use the USB power supply, adopt the UART interface to communicate between low-power consumption microcontroller and the USB commentaries on classics serial port chip;
C, auxiliary equipment is set
Adopting PC or pad is auxiliary equipment;
D, communication modes
Adopt the 802.15.4 network to communicate between wireless die and the USB wireless adapter; Adopt USB interface to communicate between USB wireless adapter and the electronic equipment;
E, enforcement recreation
After ⅰ, the energising, the wireless electron dice gets into the 802.15.4 network; After the USB wireless adapter connects electronic assistance aids, receive user's startup command after, add the 802.15.4 network again;
ⅱ, user's throwing wireless electron dice, the acceleration of gravity sensor sends interrupt signal and gives the low-power consumption microcontroller, and this microcontroller is carried out the induction algorithm, calculates the action of wireless electron dice, counts, and the result is sent to the USB wireless adapter through network;
The pairing of ⅲ, USB wireless adapter: the message that the wireless electron dice of being received is sent passes to PC or pad user interactions program, to be shown to the user; User decision and which wireless electron dice pairing are sent order then and are given the USB wireless adapter, and unique ID of the wireless electron dice that the USB wireless adapter will be confirmed to match writes flash;
F, all carry out AES through the message of 802.15.4 network delivery and encrypt.
Said microcontroller is carried out the induction algorithm: the every throwing of wireless electron dice once; After the acceleration of gravity sensor detects; Just send interrupt signal and give the low-power consumption microcontroller, the low-power consumption microcontroller just is provided with timer No. one time, when timer then after; The low-power consumption microcontroller reads x axle, the y axle of N subgravity acceleration transducer, the accekeration of z axle; If the difference of first time of certain axle acceleration and the N time is then judged the throwing process end of wireless electron dice less than V, it is counting of wireless electron dice that the low-power consumption microcontroller reads counting of acceleration of gravity sensor.
The present invention can make the actual dice of user's throwing, but other processes of recreation all realize on electronic equipment PC or pad.
Description of drawings
Fig. 1 is a system block diagram of the present invention;
Fig. 2 is a wireless electron dice internal structure block diagram of the present invention;
Fig. 3 is a USB wireless adapter structured flowchart of the present invention.
The specific embodiment
Consult Fig. 1, system of the present invention comprises wireless electron dice, USB wireless adapter and PC or pad.Dice is the dice by the reality of user's throwing, and the USB wireless adapter is the receiving equipment that is inserted on PC or the pad.After the user finished the throwing of wireless electron dice, the wireless electron dice can detect current counting, and will count through IEEE 802.15.4 wireless network then sends to the USB wireless adapter, and the USB wireless adapter will be counted and sent PC or pad program to.Use the 802.15.4 network to communicate between wireless electron dice and the USB wireless adapter, use USB interface to communicate between USB wireless adapter and PC or the pad.
Consult Fig. 2; Wireless electron dice of the present invention is made up of a hollow housing and a circuit board; Circuit board is arranged in the hollow housing; Circuit board is made up of a low-power consumption microcontroller and an acceleration of gravity sensor that has wireless radio frequency modules, uses the button cell power supply, adopts the I2C interface to communicate between low-power consumption microcontroller and the acceleration of gravity sensor;
Software section uses IEEE 802.15.4 agreement as Physical layer and link layer model, and has developed application level function on this basis.Software function all realizes in the low-power consumption microcontroller.
To the button cell charging, after the operating voltage of the low-power consumption microcontroller of arrival wireless electron dice, the wireless electron dice is started working.At first, it is that 0x8001 (this value can change), network channel are the IEEE 802.15.4 network of 26 (this value can change) that the wireless electron dice gets into network ID, and generates the network address of one 16 random number conduct oneself.Because the wireless electron dice is a powered battery, so for save power, the wireless electron dice will get into sleep pattern.
When user's throwing wireless electron dice, the acceleration of gravity sensor detects upset, will send interrupt signal and give the low-power consumption microcontroller, and this microcontroller is waken up from sleep, and sets the regularly timer of 100ms.If timer then before microcontroller received an interrupt signal that transmits from the acceleration of gravity sensor again, then microcontroller resets timer, promptly from begin regularly 100ms this moment.When timer then after; Microcontroller reads x axle, the y axle of N subgravity acceleration transducer, the accekeration of z axle; If the difference of the first time of certain axle acceleration and the N time is less than V; The throwing process of then judging the wireless electron dice is through with, and microcontroller just reads counting of acceleration of gravity sensor, and sends to the USB wireless adapter.If the first time of three axle accelerations and the N time difference all are not less than V, judge that then the throwing process of dice does not also finish, do not send any information and give the USB wireless adapter.Which kind of situation no matter, the wireless electron dice all will return sleep pattern.
The wireless electron dice sends in the message of USB wireless adapter except when outside preceding the counting, also have extended address (globally unique ID) and the current battery dump energy of oneself.
Dice uses aes algorithm with message encryption earlier before sending message.
Consult Fig. 3; USB wireless adapter of the present invention is made up of a plastic casing and a circuit board; Circuit board is arranged in the plastic casing; Circuit board is made up of a low-power consumption microcontroller and a USB commentaries on classics serial port chip that has wireless radio frequency modules, uses the USB power supply, adopts the UART interface to communicate between low-power consumption microcontroller and the USB commentaries on classics serial port chip.Software section uses IEEE 802.15.4 agreement as Physical layer and link layer model, and has developed application level function on this basis.Software function all realizes in microcontroller.
After the USB wireless adapter inserted PC or pad, PC or pad were its power supply through USB interface.The USB wireless adapter can not add network automatically, does not get into sleep pattern yet.The user sends order through PC or pad user interactions program to the USB wireless adapter: start the USB wireless adapter, get into the pairing state, check matching table, cancel pairing, withdraw from the pairing state, close the USB wireless adapter.USB changes serial port chip can realize a virtual serial port on PC or pad, make the USB wireless adapter be connected through USB interface on hardware with PC or pad, but on software, use serial communication.
After receiving that starting the USB wireless adapter orders, the USB wireless adapter will add network, and ID is that 0x8001, network channel are 26 IEEE 802.15.4 network, and select the network address of 0x0000 as oneself.
After receiving entering pairing status command, the USB wireless adapter will get into the pairing state, and this moment, the USB wireless adapter will all send to PC or pad user interactions program to the message that all wireless electron dices send.
Receive check matching table order after, the USB wireless adapter will send to the matching table among the own flash PC or pad user interactions program.
After receiving cancellation pairing order, the USB wireless adapter will be deleted certain bar unpaired message of PC or the appointment of pad user interactions program from matching table.
Receive withdraw from the pairing status command after; The USB wireless adapter will withdraw from the pairing state; The user can select whether to write flash to new matching table, and this moment, the USB wireless adapter only can send to PC or pad user interactions program to the message that the wireless electron dice that is arranged in matching table sends.
Receive close USB wireless adapter message after, the USB wireless adapter will no longer send to PC or pad user interactions program to the message that receives.
After receiving the message of wireless electron dice transmission, the USB wireless adapter at first uses aes algorithm to decipher.If the USB wireless adapter at the pairing state, then sends to PC or pad user interactions program with message, if the USB wireless adapter is not at the pairing state; Then check matching table; The extended address of wireless electron dice that judge to send message whether in matching table, if, just send message and give PC or pad user interactions program; Otherwise, just ignore this message.
The extended address that has the wireless electron dice that matched with this USB wireless adapter in the matching table.Matching table can be stored three such addresses altogether, and promptly a USB wireless adapter can match with three dices.
Embodiment
It is that 0x8001, network channel are 26 IEEE 802.15.4 network that wireless electron dice energising back gets into ID, and generates the network address of one 16 random number conduct oneself.Get into sleep state then.
Throwing wireless electron dice after the acceleration of gravity sensor detects rotation, sends interrupt signal and gives microprocessor, and microprocessor is waken up from sleep, and regularly 100ms of timer is set then.
If timer then before microcontroller received an interrupt signal that transmits from the acceleration of gravity sensor again, then microcontroller resets timer, promptly from begin regularly 100ms this moment.
When timer then after; Microcontroller reads x axle, the y axle of 20 subgravity acceleration transducers, the accekeration of z axle; If the difference of the first time of certain axle acceleration and the 20th time is less than 0x0100; The throwing process of then judging dice is through with, and microcontroller just reads counting of acceleration of gravity sensor, and sends to the USB wireless adapter.If the difference of the first time of three axle accelerations and the 20th time all is not less than 0x0100, judge that then the throwing process of dice also finishes, do not send any information and give the USB wireless adapter.
It is following that the wireless electron dice sends to the message format of USB wireless adapter.
The wireless electron dice uses aes algorithm that payload segment is encrypted earlier before sending message.
Timer is after then event handling finishes, and the wireless electron dice will return sleep pattern.
The USB wireless adapter at first disposes serial ports after inserting PC, from flash, reads matching table then.Order or the wireless electron dice of waiting for pc user's interactive program then send message.
After receiving the message of wireless electron dice transmission, the USB wireless adapter at first carries out the AES deciphering.
If this moment, the USB wireless adapter was in the pairing state, the USB wireless adapter just deposits the extended address of this dice in the interim matching table in so, and to pc user's interactive program transmission character string " AT& index & extended address & count & electric weight ".
If this moment, the USB wireless adapter was not in the pairing state; So the USB wireless adapter just judge this dice extended address whether in matching table, if, just send character string " AT& extended address & count & electric weight " to pc user's interactive program; Otherwise, just ignore this message.
Pc user's interactive program will show counting and battery electric quantity of current dice after receiving the message of USB wireless adapter transmission on interface.
Pc user's interactive program can also send order and give the USB wireless adapter in addition, and command definition is following.
1) starts the USB wireless adapter
Command string | f |
Function | It is that 0x8001, network channel are 26 IEEE 802.15.4 network that the USB wireless adapter adds network ID, and selects the network address of 0x0000 as oneself. |
The response character string | AT& 8001& 26; |
2) get into the pairing state
Command string | p |
Function | Make the USB wireless adapter get into the pairing state, this moment, the USB wireless adapter will all send to the PC program to the message that all dices send. |
The response character string | AT& PAIR; |
3) check matching table
Command string | i |
Function | The USB wireless adapter will send to the matching table among the own flash PC program. |
The response character string | AT& 1& Extended address; AT& 2& Extended address; AT& 3& Extended address; |
4) cancellation pairing
Command string | 1 |
Function | The USB wireless adapter will be deleted article one unpaired message from matching table.This order can only be used under the pairing state. |
The response character string | AT& SUCC; |
Command string | 2 |
Function | The USB wireless adapter will be deleted the second unpaired message from matching table.This order can only be used under the pairing state. |
The response character string | AT& SUCC; |
Command string | 3 |
Function | The USB wireless adapter will be deleted the 3rd unpaired message from matching table.This order can only be used under the pairing state. |
The response character string | AT& SUCC; |
5) withdraw from the pairing state
Command string | d |
Function | Make the USB wireless adapter withdraw from the pairing state, the USB wireless adapter writes flash with new matching table, and this moment, the USB wireless adapter only can send to the PC program to the message that the dice that is arranged in matching table sends. |
The response character string | AT& PAIRED; |
Command string | o |
Function | Make the USB wireless adapter withdraw from the pairing state, the USB wireless adapter can not write flash to new matching table, and this moment, the USB wireless adapter only can send to the PC program to the message that the dice that is arranged in matching table sends. |
The response character string | AT& PAIRED; |
6) close the USB wireless adapter
Command string | x |
Function | The USB wireless adapter will no longer send to the PC program to the message that receives. |
The response character string | AT& EXIT; |
7) obtain USB wireless adapter ID
Command string | u |
Function | The USB wireless adapter sends to the PC program with the globally unique ID of oneself. |
The response character string | AT& Extended address; |
Claims (2)
1. the implementation method of a wireless electron dice game system is characterized in that this method comprises following concrete steps:
A, the wireless electron dice is set
The wireless electron dice is made up of a hollow housing and a circuit board; Circuit board is arranged in the hollow housing; The hollow housing surface is respectively equipped with difference and counts; Circuit board is made up of a low-power consumption microcontroller and an acceleration of gravity sensor that has wireless radio frequency modules, uses the button cell power supply, adopts the I2C interface to communicate between low-power consumption microcontroller and the acceleration of gravity sensor;
B, the USB wireless adapter is set
The USB wireless adapter is made up of a plastic casing and a circuit board; Circuit board is arranged in the plastic casing; Circuit board is made up of a low-power consumption microcontroller and a USB commentaries on classics serial port chip that has wireless radio frequency modules; Use the USB power supply, adopt the UART interface to communicate between low-power consumption microcontroller and the USB commentaries on classics serial port chip; C, auxiliary equipment is set
Adopting PC or pad is auxiliary equipment;
D, communication modes
Adopt the 802.15.4 network to communicate between wireless die and the USB wireless adapter; Adopt USB interface to communicate between USB wireless adapter and the electronic equipment; E, enforcement recreation
After ⅰ, the energising, the wireless electron dice gets into the 802.15.4 network; After the USB wireless adapter connects auxiliary equipment, receive user's startup command after, add the 802.15.4 network again;
ⅱ, user's throwing wireless electron dice, the acceleration of gravity sensor sends interrupt signal and gives the low-power consumption microcontroller, and this microcontroller is carried out the induction algorithm, calculates the action of wireless electron dice, counts, and the result is sent to the USB wireless adapter through network;
The pairing of ⅲ, USB wireless adapter: the message that the wireless electron dice of being received is sent passes to PC or pad user interactions program, to be shown to the user; User decision and which wireless electron dice pairing are sent order then and are given the USB wireless adapter, and unique ID of the wireless electron dice that the USB wireless adapter will be confirmed to match writes flash;
F, all carry out AES through the message of 802.15.4 network delivery and encrypt.
2. implementation method according to claim 1; It is characterized in that said microcontroller execution induction algorithm is: the every throwing of wireless electron dice once after the acceleration of gravity sensor detects, is just sent an interrupt signal and is given the low-power consumption microcontroller; The low-power consumption microcontroller just is provided with timer No. one time; When timer then after, the low-power consumption microcontroller reads x axle, the y axle of N subgravity acceleration transducer, the accekeration of z axle, if the difference of the first time of certain axle acceleration and the N time is less than V; The throwing process of then judging the wireless electron dice finishes, and it is counting of wireless electron dice that the low-power consumption microcontroller reads counting of acceleration of gravity sensor.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2012102068508A CN102772896A (en) | 2012-06-21 | 2012-06-21 | Method for realizing wireless electronic dice game system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2012102068508A CN102772896A (en) | 2012-06-21 | 2012-06-21 | Method for realizing wireless electronic dice game system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN102772896A true CN102772896A (en) | 2012-11-14 |
Family
ID=47118144
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN2012102068508A Pending CN102772896A (en) | 2012-06-21 | 2012-06-21 | Method for realizing wireless electronic dice game system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN102772896A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104225910A (en) * | 2014-09-25 | 2014-12-24 | 苏州乐聚一堂电子科技有限公司 | Radio-frequency induction dice |
TWI757119B (en) * | 2021-03-18 | 2022-03-01 | 名豐電子股份有限公司 | Dice with composite structure |
TWI760672B (en) * | 2019-12-30 | 2022-04-11 | 陳冠廷 | Rolling structure device of dice game machine |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20050215312A1 (en) * | 2004-03-29 | 2005-09-29 | Tresser Yuval A | Dice that recognize the values of their own throws and transmit them to computers, with applications to electronic and casino games |
US20110018194A1 (en) * | 2009-07-27 | 2011-01-27 | Igt | Self-contained dice shaker system |
KR101052485B1 (en) * | 2011-04-14 | 2011-07-28 | 주식회사 해빛솔루션 | Electronic dice and method for determining a dice number thereof |
-
2012
- 2012-06-21 CN CN2012102068508A patent/CN102772896A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20050215312A1 (en) * | 2004-03-29 | 2005-09-29 | Tresser Yuval A | Dice that recognize the values of their own throws and transmit them to computers, with applications to electronic and casino games |
US20110018194A1 (en) * | 2009-07-27 | 2011-01-27 | Igt | Self-contained dice shaker system |
KR101052485B1 (en) * | 2011-04-14 | 2011-07-28 | 주식회사 해빛솔루션 | Electronic dice and method for determining a dice number thereof |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104225910A (en) * | 2014-09-25 | 2014-12-24 | 苏州乐聚一堂电子科技有限公司 | Radio-frequency induction dice |
TWI760672B (en) * | 2019-12-30 | 2022-04-11 | 陳冠廷 | Rolling structure device of dice game machine |
TWI757119B (en) * | 2021-03-18 | 2022-03-01 | 名豐電子股份有限公司 | Dice with composite structure |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104301973B (en) | A kind of method of wireless body area network fast wake-up association | |
CN104949707B (en) | Motion monitoring device and method based on information push | |
TW201245966A (en) | USB converter, USB connector system and converting method of USB signal | |
CN103445409A (en) | Intelligent bracelet | |
CN102772896A (en) | Method for realizing wireless electronic dice game system | |
CN107516917A (en) | Charge control method, terminal, intelligent charge equipment and computer-readable storage medium | |
CN203424934U (en) | Multipurpose intelligent health data collecting module | |
CN204840552U (en) | Atomizer atomizing information monitoring devices | |
CN106506296A (en) | A kind of control method of smart machine and control system | |
CN105955539A (en) | Touch apparatus and method | |
CN103092641A (en) | Electronic device | |
CN204945114U (en) | A kind of portable smoke detector | |
CN109582374A (en) | A kind of electronic equipment sleep control method, system and electronic equipment and storage medium | |
CN104796166B (en) | A kind of wireless accessory awakening method and wireless accessory | |
CN106022059B (en) | A kind of unlocked by fingerprint method and terminal | |
CN204704845U (en) | A kind of electronic intelligence lighter of assisting to give up smoking | |
CN208172750U (en) | Converter for smart machine | |
CN203896347U (en) | Bluetooth-based fixed-point information release system | |
CN202028173U (en) | Game pad interacted with cell phone | |
CN108667099A (en) | A kind of wearable device, mobile terminal and charging system | |
CN201910107U (en) | Radio-frequency multichannel answering racer | |
CN206312315U (en) | A kind of long-range inspection warning device of opposing electricity-stealing | |
CN203455774U (en) | Portable input device | |
CN206848831U (en) | Temperature control device | |
CN208823926U (en) | The infrared auxiliary water bullet battle equipment of true man CS |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C02 | Deemed withdrawal of patent application after publication (patent law 2001) | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20121114 |