Movatterモバイル変換


[0]ホーム

URL:


CN102772896A - Method for realizing wireless electronic dice game system - Google Patents

Method for realizing wireless electronic dice game system
Download PDF

Info

Publication number
CN102772896A
CN102772896ACN2012102068508ACN201210206850ACN102772896ACN 102772896 ACN102772896 ACN 102772896ACN 2012102068508 ACN2012102068508 ACN 2012102068508ACN 201210206850 ACN201210206850 ACN 201210206850ACN 102772896 ACN102772896 ACN 102772896A
Authority
CN
China
Prior art keywords
usb
wireless
dice
wireless adapter
electronic dice
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
Application number
CN2012102068508A
Other languages
Chinese (zh)
Inventor
沈建华
邢诗宁
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
East China Normal University
Original Assignee
East China Normal University
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by East China Normal UniversityfiledCriticalEast China Normal University
Priority to CN2012102068508ApriorityCriticalpatent/CN102772896A/en
Publication of CN102772896ApublicationCriticalpatent/CN102772896A/en
Pendinglegal-statusCriticalCurrent

Links

Images

Landscapes

Abstract

Translated fromChinese

本发明公开了一种无线电子骰子游戏系统的实现方法,该方法包括设置无线电子骰子、USB无线适配器和PC或pad,无线电子骰子是可抛掷的实际骰子,USB无线适配器是插在PC或pad上的接收设备。当用户将无线电子骰子抛掷完毕后,无线电子骰子能够检测到当前的点数,然后通过IEEE802.15.4无线网络将点数发送给USB无线适配器,USB无线适配器再将点数传送给PC或pad用户交互程序。无线电子骰子和USB无线适配器之间使用802.15.4网络进行通信,USB无线适配器和PC或pad之间使用USB接口进行通信。本发明可使用户抛掷实际的骰子,但游戏的其他过程均在电子设备PC或pad上实现。The invention discloses a method for implementing a wireless electronic dice game system. The method includes setting a wireless electronic dice, a USB wireless adapter and a PC or pad. The wireless electronic dice is an actual dice that can be thrown, and the USB wireless adapter is inserted into the PC or pad. on the receiving device. After the user finishes throwing the wireless electronic dice, the wireless electronic dice can detect the current points, and then send the points to the USB wireless adapter through the IEEE802.15.4 wireless network, and the USB wireless adapter then transmits the points to the PC or pad user interaction program. The 802.15.4 network is used for communication between the wireless electronic dice and the USB wireless adapter, and the USB interface is used for communication between the USB wireless adapter and the PC or pad. The invention can make the user throw the actual dice, but other processes of the game are all realized on the electronic device PC or pad.

Description

Translated fromChinese
一种无线电子骰子游戏系统的实现方法Implementation method of a wireless electronic dice game system

技术领域technical field

本发明涉及以IEEE 802.15.4协议为基础的无线星型网络游戏系统,特别是一种无线电子骰子游戏系统的实现方法。The invention relates to a wireless star network game system based on the IEEE 802.15.4 protocol, in particular to a method for realizing a wireless electronic dice game system.

背景技术Background technique

目前市场上使用到骰子的游戏有两种,一种是实际的骰子,用户可以抛掷,并读取朝上一面的点数,然后继续游戏,用户需要备有其他物品以供游戏使用,这期间不涉及电子设备如PC、pad的使用。另一种是在PC或pad上模拟骰子,所有游戏过程均在电子设备上实现,用户只需要有一个PC或pad,不需要其他任何物品。There are currently two types of games that use dice on the market. One is the actual dice. The user can throw the dice and read the points on the upward side, and then continue the game. The user needs to have other items for the game. Involves the use of electronic devices such as PCs and pads. The other is to simulate dice on a PC or pad. All game processes are implemented on electronic devices. Users only need to have a PC or pad without any other items.

但对于很多人来说,还是希望能够抛掷实际的骰子,但又最好不需要准备其他物品,除了抛掷骰子外,其他游戏过程均可在电子设备上实现。However, for many people, it is still desirable to be able to throw the actual dice, but it is best not to prepare other items. Except for throwing the dice, other game processes can be realized on electronic devices.

发明内容Contents of the invention

本发明的目的是提供一种实现无线电子骰子游戏系统的方法,该方法可使用户抛掷实际的骰子,但游戏的其他过程均在电子设备PC或pad上实现。The purpose of the present invention is to provide a method of implementing a wireless electronic dice game system, which allows the user to roll the actual dice, but the other processes of the game are all realized on the electronic device PC or pad.

实现本发明目的的具体技术方案是:The concrete technical scheme that realizes the object of the invention is:

一种无线电子骰子游戏系统的实现方法,该方法包括以下具体步骤:A method for realizing a wireless electronic dice game system, the method includes the following specific steps:

a、设置无线电子骰子a. Set up wireless electronic dice

无线电子骰子由一个中空壳体和一块电路板组成,电路板设置在中空壳体内,中空壳体表面分别设有不同点数,电路板由一个带有无线射频模块的低功耗微控制器及一个重力加速度传感器组成,使用钮扣电池供电,低功耗微控制器和重力加速度传感器之间采用I2C接口进行通信;The wireless electronic dice consists of a hollow shell and a circuit board. The circuit board is set in the hollow shell. Different points are arranged on the surface of the hollow shell. It is composed of a device and a gravity acceleration sensor, powered by a button battery, and communicates between the low-power microcontroller and the gravity acceleration sensor through an I2C interface;

b、设置USB无线适配器b. Set up the USB wireless adapter

USB无线适配器由一个塑料外壳和一块电路板组成,电路板设置于塑料外壳内,电路板由一个带有无线射频模块的低功耗微控制器及一个USB转串口芯片组成,使用USB供电,低功耗微控制器和USB转串口芯片之间采用UART接口进行通信;The USB wireless adapter consists of a plastic shell and a circuit board. The circuit board is set in the plastic shell. The circuit board is composed of a low-power microcontroller with a wireless radio frequency module and a USB-to-serial chip. The UART interface is used for communication between the power consumption microcontroller and the USB-to-serial chip;

 c、设置辅助设备c. Set up auxiliary equipment

采用PC或pad为辅助设备;Use PC or pad as auxiliary equipment;

d、通讯方式d. Communication method

无线骰子与USB无线适配器之间采用802.15.4网络进行通信;USB无线适配器与电子设备之间采用USB接口进行通信;The 802.15.4 network is used for communication between the wireless dice and the USB wireless adapter; the USB interface is used for communication between the USB wireless adapter and the electronic device;

 e、实施游戏e. Implement the game

ⅰ、通电后,无线电子骰子进入802.15.4网络;USB无线适配器连接电子辅助设备后,收到用户的启动命令后,再加入802.15.4网络;     ⅰ. After power on, the wireless electronic dice will enter the 802.15.4 network; after the USB wireless adapter is connected to the electronic auxiliary equipment, it will join the 802.15.4 network after receiving the start command from the user;

ⅱ、用户抛掷无线电子骰子,重力加速度传感器发送中断信号给低功耗微控制器,该微控制器执行感应算法,计算无线电子骰子动作、点数,并将结果通过网络发送给USB无线适配器;     ⅱ. When the user throws the wireless electronic dice, the gravity acceleration sensor sends an interrupt signal to the low-power microcontroller, which executes the sensing algorithm, calculates the action and points of the wireless electronic dice, and sends the result to the USB wireless adapter through the network;

ⅲ、USB无线适配器的配对:将所收到的无线电子骰子发送的消息传递给PC或pad用户交互程序,以显示给用户;用户决定与哪些无线电子骰子配对,然后发送命令给USB无线适配器,USB无线适配器将确定配对的无线电子骰子的唯一ID写入flash;ⅲ, USB wireless adapter pairing: pass the received message sent by the wireless electronic dice to the PC or pad user interaction program to display to the user; the user decides which wireless electronic dice to pair with, and then sends a command to the USB wireless adapter, The USB wireless adapter writes the unique ID of the paired wireless electronic dice into flash;

 f、所有通过802.15.4网络传递的消息进行AES加密。f. All messages transmitted through the 802.15.4 network are AES encrypted.

所述微控制器执行感应算法是:无线电子骰子每抛掷一次,重力加速度传感器检测到后,便发送一次中断信号给低功耗微控制器,低功耗微控制器便设置一次定时器,当定时器到时后,低功耗微控制器读取N次重力加速度传感器的x轴、y轴、z轴的加速度值,若某个轴加速度的第一次和第N次的差值小于V,则判断无线电子骰子的抛掷过程结束,低功耗微控制器读取重力加速度传感器的点数即无线电子骰子的点数。The sensing algorithm executed by the microcontroller is: every time the wireless electronic dice is thrown once, after the acceleration of gravity sensor detects, an interrupt signal is sent to the low-power microcontroller, and the low-power microcontroller sets a timer. After the timer expires, the low-power microcontroller reads the acceleration values of the x-axis, y-axis, and z-axis of the gravity acceleration sensor for N times. If the difference between the first and Nth times of acceleration of a certain axis is less than V , it is judged that the throwing process of the wireless electronic dice is over, and the low-power microcontroller reads the points of the gravity acceleration sensor, that is, the points of the wireless electronic dice.

本发明可使用户抛掷实际的骰子,但游戏的其他过程均在电子设备PC或pad上实现。The invention can make the user throw the actual dice, but other processes of the game are all realized on the electronic device PC or pad.

附图说明Description of drawings

图1为本发明系统框图;Fig. 1 is a system block diagram of the present invention;

图2为本发明无线电子骰子内部结构框图;Fig. 2 is a block diagram of the internal structure of the wireless electronic dice of the present invention;

图3为本发明USB无线适配器结构框图。Fig. 3 is a structural block diagram of the USB wireless adapter of the present invention.

具体实施方式Detailed ways

参阅图1,本发明的系统包括无线电子骰子、USB无线适配器和PC或pad。骰子是由用户抛掷的实际的骰子,USB无线适配器是插在PC或pad上的接收设备。当用户将无线电子骰子抛掷完毕后,无线电子骰子能够检测到当前的点数,然后通过IEEE 802.15.4无线网络将点数发送给USB无线适配器,USB无线适配器再将点数传送给PC或pad程序。无线电子骰子和USB无线适配器之间使用802.15.4网络进行通信,USB无线适配器和PC或pad之间使用USB接口进行通信。Referring to Fig. 1, the system of the present invention includes wireless electronic dice, USB wireless adapter and PC or pad. The dice are the actual dice rolled by the user, and the USB wireless adapter is the receiving device that plugs into the PC or pad. After the user finishes throwing the wireless electronic dice, the wireless electronic dice can detect the current points, and then send the points to the USB wireless adapter through the IEEE 802.15.4 wireless network, and the USB wireless adapter then transmits the points to the PC or pad program. The 802.15.4 network is used for communication between the wireless electronic dice and the USB wireless adapter, and the USB interface is used for communication between the USB wireless adapter and the PC or pad.

参阅图2, 本发明的无线电子骰子由一个中空壳体和一块电路板组成,电路板设置在中空壳体内,电路板由一个带有无线射频模块的低功耗微控制器及一个重力加速度传感器组成,使用钮扣电池供电,低功耗微控制器和重力加速度传感器之间采用I2C接口进行通信;Referring to Fig. 2, the wireless electronic dice of the present invention is made up of a hollow housing and a circuit board, and the circuit board is arranged in the hollow housing, and the circuit board is composed of a low-power microcontroller with a radio frequency module and a gravity The acceleration sensor is composed of a button battery for power supply, and the I2C interface is used for communication between the low-power microcontroller and the gravity acceleration sensor;

软件部分使用IEEE 802.15.4协议作为物理层和链路层模型,并在此基础上开发了应用层功能。软件功能均在低功耗微控制器中实现。The software part uses the IEEE 802.15.4 protocol as the physical layer and link layer model, and develops the application layer function on this basis. The software functions are implemented in a low-power microcontroller.

给钮扣电池充电,到达无线电子骰子的低功耗微控制器的工作电压后,无线电子骰子开始工作。首先,无线电子骰子进入网络ID为0x8001(该值可以改变)、网络信道为26(该值可以改变)的IEEE 802.15.4网络,并生成一个16位的随机数作为自己的网络地址。由于无线电子骰子是电池供电,所以为了节约电量,无线电子骰子将进入睡眠模式。After charging the button battery and reaching the operating voltage of the low-power microcontroller of the wireless electronic dice, the wireless electronic dice starts to work. First, the wireless electronic dice enters the IEEE 802.15.4 network with the network ID of 0x8001 (the value can be changed) and the network channel of 26 (the value can be changed), and generates a 16-bit random number as its own network address. Since the wireless electronic dice is powered by batteries, in order to save power, the wireless electronic dice will enter sleep mode.

当用户抛掷无线电子骰子时,重力加速度传感器检测到翻转,就会发送中断信号给低功耗微控制器,该微控制器从睡眠中醒来,并设定一个定时100ms的定时器。如果定时器到时之前微控制器又收到了一个从重力加速度传感器传来的中断信号,则微控制器重新设定定时器,即从此刻开始定时100ms。当定时器到时后,微控制器读取N次重力加速度传感器的x轴、y轴、z轴的加速度值,如果某个轴加速度的第一次和第N次的差值小于V,则判断无线电子骰子的抛掷过程已经结束了,微控制器就读取重力加速度传感器的点数,并发送给USB无线适配器。如果三个轴加速度的第一次和第N次的差值都不小于V,则判断骰子的抛掷过程还未结束,不发送任何信息给USB无线适配器。无论哪种情况,无线电子骰子都将返回睡眠模式。When the user rolls the wireless electronic dice, the G-sensor detects a rollover and sends an interrupt signal to the low-power microcontroller, which wakes up from sleep and sets a 100ms timer. If the microcontroller receives an interrupt signal from the gravity acceleration sensor before the timer expires, the microcontroller resets the timer, that is, starts timing 100ms from this moment. When the timer expires, the microcontroller reads the acceleration values of the x-axis, y-axis, and z-axis of the gravity acceleration sensor for N times. If the difference between the first time and the Nth time of a certain axis acceleration is less than V, then Judging that the throwing process of the wireless electronic dice has ended, the microcontroller reads the points of the acceleration of gravity sensor and sends them to the USB wireless adapter. If the difference between the first and Nth accelerations of the three axes is not less than V, it is judged that the throwing process of the dice is not over yet, and no information is sent to the USB wireless adapter. In either case, the wireless electronic dice will return to sleep mode.

无线电子骰子发送给USB无线适配器的消息中除了当前的点数外,还有自己的扩展地址(全球唯一的ID)及当前电池剩余电量。In addition to the current points, the message sent by the wireless electronic dice to the USB wireless adapter also has its own extended address (a globally unique ID) and the current remaining battery power.

骰子发送消息之前先使用AES算法将消息加密。Dice uses the AES algorithm to encrypt the message before sending it.

参阅图3,本发明的USB无线适配器由一个塑料外壳和一块电路板组成,电路板设置于塑料外壳内,电路板由一个带有无线射频模块的低功耗微控制器及一个USB转串口芯片组成,使用USB供电,低功耗微控制器和USB转串口芯片之间采用UART接口进行通信。     软件部分使用IEEE 802.15.4协议作为物理层和链路层模型,并在此基础上开发了应用层功能。软件功能均在微控制器中实现。Referring to Fig. 3, the USB wireless adapter of the present invention is made up of a plastic shell and a circuit board, and the circuit board is arranged in the plastic shell, and the circuit board consists of a low-power microcontroller with a wireless radio frequency module and a USB-to-serial port chip It is composed of USB power supply, and the low-power microcontroller and USB-to-serial chip use UART interface for communication. The software part uses the IEEE 802.15.4 protocol as the physical layer and link layer model, and develops the application layer function on this basis. The software functions are implemented in the microcontroller.

USB无线适配器插入PC或pad后,PC或pad通过USB接口为其供电。USB无线适配器不会自动加入网络,也不进入睡眠模式。用户通过PC或pad用户交互程序向USB无线适配器发送命令:启动USB无线适配器、进入配对状态、查看配对表、取消配对、退出配对状态、关闭USB无线适配器。USB转串口芯片能够在PC或pad上实现一个虚拟串口,使得USB无线适配器和PC或pad在硬件上通过USB接口连接,但在软件上使用串口通信。After the USB wireless adapter is inserted into the PC or pad, the PC or pad supplies power to it through the USB interface. USB wireless adapters will not automatically join a network, nor will they go into sleep mode. The user sends commands to the USB wireless adapter through the PC or pad user interaction program: start the USB wireless adapter, enter the pairing state, view the pairing table, cancel pairing, exit the pairing state, and turn off the USB wireless adapter. The USB-to-serial port chip can implement a virtual serial port on the PC or pad, so that the USB wireless adapter and the PC or pad are connected through the USB interface on the hardware, but the serial port communication is used on the software.

收到启动USB无线适配器命令后,USB无线适配器将加入网络,ID为0x8001、网络信道为26的IEEE 802.15.4网络,并选择0x0000作为自己的网络地址。After receiving the command to start the USB wireless adapter, the USB wireless adapter will join the network, the IEEE 802.15.4 network with ID 0x8001 and network channel 26, and select 0x0000 as its own network address.

收到进入配对状态命令后,USB无线适配器将进入配对状态,此时USB无线适配器将会把所有无线电子骰子发送的消息都发送给PC或pad用户交互程序。After receiving the command to enter the pairing state, the USB wireless adapter will enter the pairing state. At this time, the USB wireless adapter will send all the messages sent by the wireless electronic dice to the PC or pad user interaction program.

收到查看配对表命令后,USB无线适配器将会把自己flash中的配对表发送给PC或pad用户交互程序。After receiving the command to view the pairing table, the USB wireless adapter will send the pairing table in its own flash to the PC or pad user interaction program.

收到取消配对命令后,USB无线适配器将会把PC或pad用户交互程序指定的某条配对信息从配对表中删除。After receiving the cancel pairing command, the USB wireless adapter will delete a piece of pairing information specified by the PC or pad user interaction program from the pairing table.

收到退出配对状态命令后,USB无线适配器将会退出配对状态,用户可以选择是否把新的配对表写入flash,此时USB无线适配器只会把位于配对表中的无线电子骰子发送的消息发送给PC或pad用户交互程序。After receiving the command to exit the pairing state, the USB wireless adapter will exit the pairing state, and the user can choose whether to write the new pairing table into flash. At this time, the USB wireless adapter will only send the message sent by the wireless electronic dice in the pairing table. Interactive program for PC or pad users.

收到关闭USB无线适配器消息后,USB无线适配器将不再把接收到的消息发送给PC或pad用户交互程序。After receiving the message of turning off the USB wireless adapter, the USB wireless adapter will no longer send the received message to the PC or pad user interaction program.

接收到无线电子骰子发送的消息后,USB无线适配器首先使用AES算法进行解密。如果USB无线适配器在配对状态,则将消息发送给PC或pad用户交互程序,如果USB无线适配器不在配对状态,则查看配对表,判断发送消息的无线电子骰子的扩展地址是否在配对表中,如果在,就发送消息给PC或pad用户交互程序,否则,就忽略这个消息。After receiving the message sent by the wireless electronic dice, the USB wireless adapter first uses the AES algorithm to decrypt. If the USB wireless adapter is in the pairing state, then send the message to the PC or pad user interaction program, if the USB wireless adapter is not in the pairing state, check the pairing table to determine whether the extended address of the wireless electronic dice that sends the message is in the pairing table, if If yes, send a message to the PC or pad user interaction program, otherwise, ignore this message.

配对表中存有与该USB无线适配器配对过的无线电子骰子的扩展地址。配对表一共能够存储三个这样的地址,即一个USB无线适配器能与三个骰子配对。The extended address of the wireless electronic device paired with the USB wireless adapter is stored in the pairing table. The pairing table can store three such addresses in total, that is, one USB wireless adapter can be paired with three dice.

实施例Example

无线电子骰子通电后进入ID为0x8001、网络信道为26的IEEE 802.15.4网络,并生成一个16位的随机数作为自己的网络地址。然后进入睡眠状态。After the wireless electronic dice is powered on, it enters the IEEE 802.15.4 network with an ID of 0x8001 and a network channel of 26, and generates a 16-bit random number as its own network address. Then go to sleep.

抛掷无线电子骰子,重力加速度传感器检测到转动后,发送中断信号给微处理器,微处理器从睡眠中醒来,然后设置定时器定时100ms。Throwing the wireless electronic dice, after the acceleration of gravity sensor detects the rotation, sends an interrupt signal to the microprocessor, the microprocessor wakes up from sleep, and then sets the timer for 100ms.

如果定时器到时之前微控制器又收到了一个从重力加速度传感器传来的中断信号,则微控制器重新设定定时器,即从此刻开始定时100ms。If the microcontroller receives an interrupt signal from the gravity acceleration sensor before the timer expires, the microcontroller resets the timer, that is, starts timing 100ms from this moment.

当定时器到时后,微控制器读取20次重力加速度传感器的x轴、y轴、z轴的加速度值,如果某个轴加速度的第一次和第20次的差值小于0x0100,则判断骰子的抛掷过程已经结束了,微控制器就读取重力加速度传感器的点数,并发送给USB无线适配器。如果三个轴加速度的第一次和第20次的差值都不小于0x0100,则判断骰子的抛掷过程还未结束,不发送任何信息给USB无线适配器。When the timer expires, the microcontroller reads the acceleration values of the x-axis, y-axis, and z-axis of the gravity acceleration sensor for 20 times. If the difference between the first and 20th acceleration values of a certain axis is less than 0x0100, then Judging that the throwing process of the dice has ended, the microcontroller reads the points of the acceleration of gravity sensor and sends them to the USB wireless adapter. If the difference between the first and 20th accelerations of the three axes is not less than 0x0100, it is judged that the throwing process of the dice is not over yet, and no information is sent to the USB wireless adapter.

无线电子骰子发送给USB无线适配器的消息格式如下。The message format that the wireless electronic dice sends to the USB wireless adapter is as follows.

Figure 261547DEST_PATH_IMAGE001
Figure 261547DEST_PATH_IMAGE001

无线电子骰子发送消息之前先使用AES算法将载荷部分加密。The wireless electronic dice uses the AES algorithm to encrypt the payload part before sending the message.

定时器到时事件处理完毕后,无线电子骰子将返回睡眠模式。When the timer expires and the event is processed, the wireless electronic dice will return to sleep mode.

USB无线适配器插入PC后,首先配置串口,然后从flash中读出配对表。然后等待PC用户交互程序的命令或无线电子骰子发送消息。After the USB wireless adapter is plugged into the PC, configure the serial port first, and then read the pairing table from the flash. It then waits for a command from the PC user interaction program or a message from the wireless electronic dice.

接收到无线电子骰子发送的消息后,USB无线适配器首先进行AES解密。After receiving the message sent by the wireless electronic dice, the USB wireless adapter first performs AES decryption.

如果此时USB无线适配器处于配对状态,那么USB无线适配器就将这个骰子的扩展地址存入临时配对表中,并向PC用户交互程序发送字符串“AT&索引&扩展地址&点数&电量”。If the USB wireless adapter is in the pairing state at this time, the USB wireless adapter will store the extended address of the dice in the temporary pairing table, and send the character string "AT&index&extended address&points&power" to the PC user interaction program.

如果此时USB无线适配器不处在配对状态,那么USB无线适配器就判断这个骰子的扩展地址是否在配对表中,如果在,就向PC用户交互程序发送字符串“AT&扩展地址&点数&电量”,否则,就忽略这个消息。If the USB wireless adapter is not in the pairing state at this time, the USB wireless adapter will judge whether the extended address of the dice is in the pairing table, and if so, send the string "AT&extended address&points&power" to the PC user interaction program , otherwise, ignore the message.

PC用户交互程序收到USB无线适配器发送的消息后,将在游戏界面上显示当前骰子的点数及其电池电量。After the PC user interaction program receives the message sent by the USB wireless adapter, it will display the current number of dice and its battery power on the game interface.

另外PC用户交互程序还可以发送命令给USB无线适配器,命令定义如下。In addition, the PC user interactive program can also send commands to the USB wireless adapter, and the commands are defined as follows.

1)      启动USB无线适配器1) Power on the USB wireless adapter

命令字符串command stringff功能FunctionUSB无线适配器加入网络ID为0x8001、网络信道为26的IEEE 802.15.4网络,并选择0x0000作为自己的网络地址。The USB wireless adapter joins the IEEE 802.15.4 network whose network ID is 0x8001 and network channel is 26, and selects 0x0000 as its own network address.响应字符串response stringAT&8001&26;AT&8001&26;

 2)        进入配对状态2) Enter the pairing state

命令字符串command stringpp功能Function令USB无线适配器进入配对状态,此时USB无线适配器将会把所有骰子发送的消息都发送给PC程序。Let the USB wireless adapter enter the pairing state, at this time the USB wireless adapter will send all the messages sent by the dice to the PC program.响应字符串response stringAT&PAIR;AT&PAIR;

 3)        查看配对表3) View the pairing table

命令字符串command stringii功能FunctionUSB无线适配器将会把自己flash中的配对表发送给PC程序。The USB wireless adapter will send the pairing table in its own flash to the PC program.响应字符串response stringAT&1&扩展地址; AT&2&扩展地址; AT&3&扩展地址;AT&1&extended address; AT&2&extended address; AT&3&extended address;

 4)        取消配对4) Unpair

命令字符串command string11功能FunctionUSB无线适配器将会把第一条配对信息从配对表中删除。这条命令只能在配对状态下使用。The USB wireless adapter will delete the first pairing information from the pairing table. This command can only be used in pairing state.响应字符串response stringAT≻AT≻

命令字符串command string22功能FunctionUSB无线适配器将会把第二条配对信息从配对表中删除。这条命令只能在配对状态下使用。The USB wireless adapter will delete the second pairing information from the pairing table. This command can only be used in the pairing state.响应字符串response stringAT≻AT≻

命令字符串command string33功能FunctionUSB无线适配器将会把第三条配对信息从配对表中删除。这条命令只能在配对状态下使用。The USB wireless adapter will delete the third pairing information from the pairing list. This command can only be used in the pairing state.响应字符串response stringAT≻AT≻

 5)        退出配对状态5) Exit the pairing state

命令字符串command stringdd功能Function令USB无线适配器退出配对状态,USB无线适配器将新的配对表写入flash,此时USB无线适配器只会把位于配对表中的骰子发送的消息发送给PC程序。The USB wireless adapter is made to exit the pairing state, and the USB wireless adapter writes the new pairing table into flash, and at this time, the USB wireless adapter will only send the message sent by the dice located in the pairing table to the PC program.响应字符串response stringAT&PAIRED;AT&PAIRED;

命令字符串command stringoo功能Function令USB无线适配器退出配对状态,USB无线适配器不会把新的配对表写入flash,此时USB无线适配器只会把位于配对表中的骰子发送的消息发送给PC程序。Make the USB wireless adapter exit the pairing state, the USB wireless adapter will not write the new pairing table into the flash, and at this time, the USB wireless adapter will only send the message sent by the dice located in the pairing table to the PC program.响应字符串response stringAT&PAIRED;AT&PAIRED;

 6)        关闭USB无线适配器6) Close the USB wireless adapter

命令字符串command stringxx功能FunctionUSB无线适配器将不再把接收到的消息发送给PC程序。The USB wireless adapter will no longer send received messages to the PC program.响应字符串response stringAT&EXIT;AT&EXIT;

 7)        获取USB无线适配器ID7) Get the USB wireless adapter ID

命令字符串command stringuu功能FunctionUSB无线适配器将自己的全球唯一的ID发送给PC程序。The USB wireless adapter sends its own globally unique ID to the PC program.响应字符串response stringAT&扩展地址;AT&Extended Address;

Claims (2)

Translated fromChinese
1.一种无线电子骰子游戏系统的实现方法,其特征在于该方法包括以下具体步骤:1. A method for realizing a wireless electronic dice game system, characterized in that the method comprises the following specific steps:a、设置无线电子骰子a. Set up wireless electronic dice无线电子骰子由一个中空壳体和一块电路板组成,电路板设置在中空壳体内,中空壳体表面分别设有不同点数,电路板由一个带有无线射频模块的低功耗微控制器及一个重力加速度传感器组成,使用钮扣电池供电,低功耗微控制器和重力加速度传感器之间采用I2C接口进行通信;The wireless electronic dice consists of a hollow shell and a circuit board. The circuit board is set in the hollow shell. Different points are arranged on the surface of the hollow shell. It is composed of a device and a gravity acceleration sensor, powered by a button battery, and communicates between the low-power microcontroller and the gravity acceleration sensor through an I2C interface;b、设置USB无线适配器b. Set up the USB wireless adapterUSB无线适配器由一个塑料外壳和一块电路板组成,电路板设置于塑料外壳内,电路板由一个带有无线射频模块的低功耗微控制器及一个USB转串口芯片组成,使用USB供电,低功耗微控制器和USB转串口芯片之间采用UART接口进行通信; c、设置辅助设备The USB wireless adapter consists of a plastic shell and a circuit board. The circuit board is set in the plastic shell. The circuit board is composed of a low-power microcontroller with a wireless radio frequency module and a USB-to-serial chip. UART interface is used for communication between the power consumption microcontroller and the USB-to-serial chip; c. Setting up auxiliary equipment采用PC或pad为辅助设备;Use PC or pad as auxiliary equipment;d、通讯方式d. Communication method无线骰子与USB无线适配器之间采用802.15.4网络进行通信;USB无线适配器与电子设备之间采用USB接口进行通信; e、实施游戏The 802.15.4 network is used for communication between the wireless dice and the USB wireless adapter; the USB interface is used for communication between the USB wireless adapter and the electronic device; e, the implementation of the gameⅰ、通电后,无线电子骰子进入802.15.4网络;USB无线适配器连接辅助设备后,收到用户的启动命令后,再加入802.15.4网络;ⅰ. After power on, the wireless electronic dice will enter the 802.15.4 network; after the USB wireless adapter is connected to the auxiliary equipment, it will join the 802.15.4 network after receiving the start command from the user; ⅱ、用户抛掷无线电子骰子,重力加速度传感器发送中断信号给低功耗微控制器,该微控制器执行感应算法,计算无线电子骰子动作、点数,并将结果通过网络发送给USB无线适配器;ⅱ. When the user throws the wireless electronic dice, the gravity acceleration sensor sends an interrupt signal to the low-power microcontroller, which executes the sensing algorithm, calculates the wireless electronic dice action and points, and sends the result to the USB wireless adapter through the network; ⅲ、USB无线适配器的配对:将所收到的无线电子骰子发送的消息传递给PC或pad用户交互程序,以显示给用户;用户决定与哪些无线电子骰子配对,然后发送命令给USB无线适配器,USB无线适配器将确定配对的无线电子骰子的唯一ID写入flash; ⅲ, USB wireless adapter pairing: pass the received message sent by the wireless electronic dice to the PC or pad user interaction program to display to the user; the user decides which wireless electronic dice to pair with, and then sends a command to the USB wireless adapter, The USB wireless adapter writes the unique ID of the paired wireless electronic dice into flash;f、所有通过802.15.4网络传递的消息进行AES加密。f. All messages transmitted through the 802.15.4 network are AES encrypted.2.根据权利要求1所述的实现方法,其特征在于所述微控制器执行感应算法是:无线电子骰子每抛掷一次,重力加速度传感器检测到后,便发送一次中断信号给低功耗微控制器,低功耗微控制器便设置一次定时器,当定时器到时后,低功耗微控制器读取N次重力加速度传感器的x轴、y轴、z轴的加速度值,若某个轴加速度的第一次和第N次的差值小于V,则判断无线电子骰子的抛掷过程结束,低功耗微控制器读取重力加速度传感器的点数即无线电子骰子的点数。2. The implementation method according to claim 1, wherein the sensing algorithm executed by the microcontroller is: every time the wireless electronic dice is thrown, after the acceleration of gravity sensor detects, an interrupt signal is sent to the low-power microcontroller device, the low-power microcontroller will set a timer, and when the timer expires, the low-power microcontroller will read the acceleration values of the x-axis, y-axis, and z-axis of the gravity acceleration sensor N times. If the difference between the first and N times of the axial acceleration is less than V, it is judged that the throwing process of the wireless electronic dice is over, and the low-power microcontroller reads the points of the gravity acceleration sensor, that is, the points of the wireless electronic dice.
CN2012102068508A2012-06-212012-06-21Method for realizing wireless electronic dice game systemPendingCN102772896A (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN2012102068508ACN102772896A (en)2012-06-212012-06-21Method for realizing wireless electronic dice game system

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN2012102068508ACN102772896A (en)2012-06-212012-06-21Method for realizing wireless electronic dice game system

Publications (1)

Publication NumberPublication Date
CN102772896Atrue CN102772896A (en)2012-11-14

Family

ID=47118144

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN2012102068508APendingCN102772896A (en)2012-06-212012-06-21Method for realizing wireless electronic dice game system

Country Status (1)

CountryLink
CN (1)CN102772896A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN104225910A (en)*2014-09-252014-12-24苏州乐聚一堂电子科技有限公司Radio-frequency induction dice
TWI757119B (en)*2021-03-182022-03-01名豐電子股份有限公司Dice with composite structure
TWI760672B (en)*2019-12-302022-04-11陳冠廷 Rolling structure device of dice game machine

Citations (3)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US20050215312A1 (en)*2004-03-292005-09-29Tresser Yuval ADice that recognize the values of their own throws and transmit them to computers, with applications to electronic and casino games
US20110018194A1 (en)*2009-07-272011-01-27IgtSelf-contained dice shaker system
KR101052485B1 (en)*2011-04-142011-07-28주식회사 해빛솔루션 Electronic Dice and How to Determine the Dice

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US20050215312A1 (en)*2004-03-292005-09-29Tresser Yuval ADice that recognize the values of their own throws and transmit them to computers, with applications to electronic and casino games
US20110018194A1 (en)*2009-07-272011-01-27IgtSelf-contained dice shaker system
KR101052485B1 (en)*2011-04-142011-07-28주식회사 해빛솔루션 Electronic Dice and How to Determine the Dice

Cited By (3)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN104225910A (en)*2014-09-252014-12-24苏州乐聚一堂电子科技有限公司Radio-frequency induction dice
TWI760672B (en)*2019-12-302022-04-11陳冠廷 Rolling structure device of dice game machine
TWI757119B (en)*2021-03-182022-03-01名豐電子股份有限公司Dice with composite structure

Similar Documents

PublicationPublication DateTitle
CN104281247B (en) Method and device for performing wake-up control
EP3462802A1 (en)Bluetooth connection method and terminal
CN104949707B (en)Motion monitoring device and method based on information push
CN108234769A (en)Falling protection method and related product
CN114365580A (en) Electronic device and low-energy-based communication connection method in electronic device
CN201887840U (en)Alarm clock processing device
CN102772896A (en)Method for realizing wireless electronic dice game system
CN110196620B (en)Wearable device and power saving method thereof
ES2965751T3 (en) Electronic device and procedure for using its storage space
EP3319375A1 (en)Terminal management method and device
CN103516913A (en)Method and device for automatic sleep awakening of mobile phone display screen
CN104158671A (en)Remote wake-up system and method
CN106066955B (en) A kind of unlocking control method and mobile terminal
US8831689B2 (en)Electronic device
US12326990B2 (en)Method for reducing device power consumption and electronic device
CN109582374A (en)A kind of electronic equipment sleep control method, system and electronic equipment and storage medium
CN115425711A (en)Charging current obtaining method and device, terminal equipment and storage medium
JP2006295956A5 (en)
CN202205163U (en)Wireless keyboard
CN206411483U (en)A kind of virtual reality helmet
WO2016015376A1 (en)Beacon device control method and beacon device
CN102141784A (en)Health protection device for preventing over-close and over-use of equipment with screen
CN113242527B (en)Communication system based on wireless somatosensory inertial measurement module
CN205287574U (en)Wear control system
CN210534732U (en)2.4G wireless and wired two-in-one dual-mode mouse circuit

Legal Events

DateCodeTitleDescription
C06Publication
PB01Publication
C10Entry into substantive examination
SE01Entry into force of request for substantive examination
C02Deemed withdrawal of patent application after publication (patent law 2001)
WD01Invention patent application deemed withdrawn after publication

Application publication date:20121114


[8]ページ先頭

©2009-2025 Movatter.jp