Summary of the invention
The present invention is in order to enable begin to learn programmer, and especially children beginner can get rid of display screen study programming skill
Art provides a kind of entity command programmed method and entity command programing system to protect the eyes of children.
The present invention is that technical solution used by realizing its technical purpose is: a kind of entity command programmed method, this method
It is middle to be attached to program instruction respectively in one group object instruction programming module, it is transmitted again after collecting instruction set using a concentrator
To operating mechanism operating instruction;It is characterized by comprising following steps:
S1, program circuit is designed according to programming purpose;
S2, from entity command programming module in option program process entity command corresponding to required instruction set program mould
Block;
S3, entity command programming module corresponding to instruction set is sequentially connected according to program circuit, the entity command is compiled
There are two interfaces interconnected for journey module tool, when two pieces of entity command programming modules are connected, one piece of entity command programming module
First interface can only be physically connected to the second interface of another piece of entity command programming module;
S4, concentrator successively collect the instruction depended in entity command programming module;
The instruction set that S5, concentrator transmission are collected is to executing agency;
S6, executing agency successively execute instruction according to the order of connection for connecing entity command programming module.
In the present invention, concentrated using the program instruction that a concentrator depends on each entity command programming module, so that just
Display screen study programming technique can be got rid of by learning programmer, especially children beginner, to protect the eye of children
Eyeball.
Further, in the entity command programmed method on: in the concentrator, at least have one be sequentially connected
Entity command programming module medial end portions the connected communication interface of an interface physical.
Further, in the entity command programmed method on: in the communication interface, a pair of of power supply line is included at least,
The power supply line obtained from concentrator power supply pass sequentially through each connection entity command programming module give entity command programming
Circuit part power supply in module;It further include having data line, the data line programs mould by sequentially connected entity command
The bus-type communication network of block realization concentrator and each entity command programming module.
Further, in the entity command programmed method on: after entity command programming module is sequentially connected, realizing collection
It, can also be to the instruction programming module of progress parameter setting in need or modification after middle device is communicated with each instruction programming module
Carry out parameter setting, comprising the following steps:
S301, the instruction programming module for needing to carry out parameter setting propose parameter setting request to concentrator;
The request of S302, concentrator response instruction programming module, into the parameter setting interface to the instruction programming module;
S303, parameter is configured using the display device and keyboard of concentrator, and is issued to instruction programming module;
S304, instruction programming module receive the instruction of concentrator, save the parameter of modification.
Further, in the entity command programmed method on: in sequentially connected entity command programming module and concentrator
After connection obtains power supply, any piece of entity command programming module therein is obtained coupled by interface interconnected
The identification code of other one piece of entity command programming module;When by bus to concentrator send instructions, according to the sequence of regulation
The identification code of the coupled two piece entity command programming module of acquisition and the identification code of itself are packaged transmission, by concentrating
Device is transferred to executing agency, after unpacking, according to identification code situation determine instruction in the entity command programming module respectively received
Execute sequence.
The present invention also provides a kind of entity command programing systems, and the entity command programming of program instruction is depended on including one group
Module, according to the concentrator that each entity command programming module positional relationship collection procedure instructs, under concentrator control
The executing agency executed program instructions according to each entity command programming module positional relationship;The entity programming module, including
The intracorporal circuit board for being provided with storage circuit, processing circuit and communication interface circuit of module case is set, in module housing
Opposite two sides are respectively arranged with the mutually cascade male connector of each entity programming module and base;It is set in the module housing
It is equipped with the data line and power supply line of corresponding contact electrical connection in male connector and base by opposite sides, on the circuit board
The two-stage of power supply is connected with the power supply of same phase respectively, and communication interface circuit is connected with corresponding data line respectively;The collection
At least with one and the male connector or the compatible base of base or male connector in entity programming module in middle device.
Further, in above-mentioned entity command programing system: the module housing is in the building blocks of cuboid
Shape, the male connector and base are separately positioned on the cascade face of module housing, and cascade face is respectively the forward and backward of module housing
Face or left and right face or upper and lower faces.
Further, in above-mentioned entity command programing system: the male connector includes that shell is arranged in cascade the convex of face
Play and be distributed in the first metal clips as contact of the raised opposite sides;The base includes being arranged in shell
The pit in another cascade face and it is distributed in second metal clips as contact of the pit with respect to two walls;The protrusion
It cooperates with pit, it is opposite with identical data line or power supply line connected the first metal clips and the second metal clips.
Further, in above-mentioned entity command programing system: the male connector and base is separately positioned on cascade face
At partial center;Fool proof column is additionally provided in the side of male connector.
Further, in above-mentioned entity command programing system: the concentrator and executing agency passes through wireless remote control
It realizes, concentrator controls executing agency.
Below with reference to drawings and examples, the present invention is described in detail.
Embodiment 1, the present embodiment are the entity programing system and a kind of small friend of training for youngsters and children study programming
A kind of educational toy of friendly programming, to the effect that by successively connecting to different entity programming modules according to the sequence of programming
It connects, the present embodiment is that a kind of children learn toy in programming, the entity volume depended on one group as various program instructions
Journey module, each instruction be attached to one piece as can be one in the present embodiment in entity programming module interconnected
Kind flagraising game, therefore, the instruction being attached in entity programming module generally comprise instruction of hoisting a flag, time delay command, give song recitals
Instruction, the instruction lowered flag, the instruction in addition also met flag, send flag, if it is raising national flag, then what is sung is the instruction for singing national anthem
Deng, entity programming module, to can according to need setting very much.
In addition, there are one the concentrator that reception depends on the program instruction of these entity programming modules, in the present embodiment,
Entity programming module mutually patches, and forms one continuous line, and empty is a plug (male connector) at one end, and what it is in other end sky is one
Base in the present embodiment, in concentrator, has a base or male connector opposite with plug or base, in this way, passing through
Any one of base or male connector can be connected with the entity programming module of one continuous line, can be this by these plugs
Connected entity programming module power supply a bit, while can also be logical by data line therein and the entity programming module of one continuous line
Letter, streamlined entity programming module are sent instruction therein in concentrator by communication, and concentrator passes through again wirelessly to be sent out
Be sent to executing agency, instruction sequences be ranked up in executing agency, then execute in sequence, in order to realize concentrator with
The communication of point-to-point between each instruction programming module in the present embodiment, is respectively provided with an ID to each instruction programming module,
Realize the communication between each instruction programming module and concentrator on communication bus, the information that concentrator is sent except broadcast message with
Outside, after instruction programming module receives the data packet that concentrator issues, only the data of to one's name ID are parsed.
In the present embodiment, executing agency includes a flag-raising platform, and having under flagpole, a flagpole above has drive flag to rise
Or the power mechanism of decline, in addition, there are also speakers etc..
Entity programming module has at least one piece as shown in Fig. 2,3,4,5,6 in such entity programming module shell 1
Circuit board 10 has memory circuit, processing circuit and communication interface circuit, the storage of different entity programming modules on circuit board
In device, be stored with different program modules, in practice, cannot functional module be stored in the electricity of the storage in different entity modules
Lu Zhong under the control of a processor can be by these functions using communication conductor or communication bus these communication interface circuits
Module is transmitted to total controller as instruction or program code.When friend teenager learns, by utilizing different entities
The different cascade system composition of programming module can complete the computer program of different function, in order to make it in conjunction with game, residence
Yu Le is taught, in the present embodiment, entity programming module shell 1 is designed to vertical equality hexagonal shape, that is, rectangular shape,
Just as a kind of building blocks, therefore, this entity programming module is also referred to as accumulated.Shell can be designed to various other switches in practice,
Such as cylindrical shape, regular hexahedron state or six face cylindricalitys.Two opposite face shapes of the shell of such entity programming module
At cascade face, in this way, all such entity programming modules can be connected with each other by two opposite cascade faces.One
Be provided on the cascade face of face one for connection male connector 3, be provided on another cascade face with the male connector matching base
2, male connector 3 is the protrusion on one piece of cascade face, and the pit on 2 another pieces of cascade faces of base, protrusion and pit cooperate.?
When two pieces of entity programming modules are cascaded as building blocks, the male connector 3 on one piece is inserted into another piece of base 2, in the present embodiment,
For the entity programming module as one piece, cascade face is located in the above and bottom surface, as shown in Figures 2 and 3, in practice,
It can be placed on other opposite two sides, such as the left side, the right side, be also possible to front back etc., as needed, but for cylinder
Building blocks for, usually two cascade faces are arranged on two discs.When male connector 3 is inserted into base 2, have in male connector 3
Elastic slice 5 will contact with each other with the elastic slice 5 in base 2, that is, be electrically connected, in this way, utilizing conducting wire by 3 He of male connector in shell 1
Corresponding elastic slice connection in base 2, these conducting wires include power supply line and data line, in the present embodiment, are respectively had in the two sides of male connector 3
Two panels elastic slice 5, is two power supply lines and two data lines respectively, in two power supply lines one be+5V electrode line, another is
Ground wire.It is low level line that one, which is one, high level line, in two data lines, can transmit equilibrium data signal in both threads.?
On circuit board 10 in entity programming module shell 1, the positive and negative anodes of power supply connect the electrode line and ground wire of power supply line respectively, and communication connects
Mouth is connected with two data lines respectively, and communication interface circuit realizes external communication by data line.
The entity programming module of the building blocks shape of the present embodiment mutually cascades very convenient, and mutually interconnects compact, two grades
Connection mask mutually cascades compact structure, and as shown in Figures 2 and 3, surrounding has flange 6 on a cascade face, has in centre
Zygostyle 4 is matched in a line connection, be provided on another cascade face two rows of connections with zygostyle 4, in the present embodiment, these
The shell 1 of entity programming module generally makes made of plastic, has certain elasticity, the certain elasticity of these tools it is mutual with zygostyle
It squeezes so that two pieces of waist of trousers programming modules be combined with each other.
In addition, in order not to make male connector 3 and base 2 not misconnection, it is additionally provided with fool-proof design in the present embodiment, and e.g., male connector 3
One side of top and bottom is separately positioned on base 2, not in centre, male connector 3 and base 2 be not right if incorrect cascade in this way
It answers, therefore, male connector 3 is inserted not into base 2, and only normal solution cascades, and male connector 3 can be just inserted into base 2.In addition, in male connector 2
Side also sets up a fool proof column 8, borrows if inserted, fool proof column 8 can prevent male connector 3 to be inserted into base 2.
In addition, on another side, being also provided with a key 9, this key 9 and circuit board in the present embodiment
Electrical connection, processing circuit can receive the information inputted from key 9, simply edited to program module.
Children are when practicing programming, as shown in Figure 1, comprising the following steps:
S1, program circuit is designed according to programming purpose;Flagraising program is such as done, then can within expect the program hoisted a flag in advance
It is: meets flag, delay, broadcasting, flagraising etc..
S2, from entity command programming module in option program process entity command corresponding to required instruction set compile
Journey module;Flagraising program is such as done, then can be found: meeting the entity commands programming module such as flag, delay, broadcasting, flagraising.
S3, entity command programming module corresponding to instruction set is sequentially connected according to program circuit, the entity refers to
Enabling programming module tool, there are two interfaces interconnected, when two pieces of entity command programming modules are connected, one piece of entity command programming
The first interface of module can only be physically connected to the second interface of another piece of entity command programming module;Flagraising program is such as done, it is small
The male connector of the entity command programming module of delay can be inserted into the base of entity command programming module for meeting flag by friend, will
In the base for playing the entity command programming module of the male connector insertion delay of the entity command programming module of music, by music of hoisting a flag
Entity command programming module male connector insertion play entity command programming module base it is medium.
In this step, it can also realize and parameter setting is carried out to certain instruction programming modules, some instruction programming modules can
To be configured to its parameter, therefore, it is provided with a key on it, by realizing parameter setting to button operation.Parameter
Setting can have many modes, such as directly utilize key selection parameter in instruction programming module, this is less to some selections
Parameter be configured, since the number of keys on programming module is limited, and do not have display device, therefore, such parameter is set
The inconvenience more to options is set, therefore, in the present embodiment, when parameter setting can be realized in concentrator, realize and concentrate
The communication of device and instruction programming module point-to-point, then using on concentrator display device and keyboard realization parameter is set
It sets.Specifically includes the following steps:
S301, the instruction programming module for needing to carry out parameter setting propose parameter setting request to concentrator.It, should in the present embodiment
Step be by the way of the key in long-pressing instruction programming module, if it is long-pressing key, then instruction programming module enter by
The mode of parameter is arranged in concentrator, sends parameter setting request to concentrator.Such as delay time is needed to reset, then long-pressing is prolonged
Key on slow time entity command programming module.
The request of S302, concentrator response instruction programming module, into the parameter setting interface to the instruction programming module.
Into delay time set interface, display is currently delay how many millisecond, such as 540ms.
S303, parameter is configured using the display device and keyboard of concentrator, and is issued to instruction programming module.Such as
It is modified by keyboard to delay time, is such as modified as 800ms.
S304, instruction programming module receive the instruction of concentrator, save the parameter of modification.In this way, the time delay module prolongs
Slow time modification is 800ms.
In the present embodiment, using concentrator there is the advantage of keyboard and display device can intuitively modify order parameter,
Facilitate modification.It modifies later order parameter to be also stored in instruction programming module, just change when only modifying parameter next time.
S4, will depend on it is therein instruction be sent in sequence in concentrator;In the step, the entity command of one continuous line is programmed
In the base that the male connector that any interface in both ends such as meets the entity command programming module of flag in module is inserted on concentrator, this
Sample, concentrator can be by that can power to the entity command programming module of one continuous line by the contact of this socket string, each entity
After the electricity of instruction programming block region, two entity command programming modules before and after it are identified, and record their identification number, record
When can mark the mark ID of entity command programming module for this side or the entity command programming module of base this side
ID is identified, in addition oneself ID itself, is packaged together with instruction, sends from the data/address bus of formation, concentrator is by connecing
Data/address bus in head receives the data packet that each entity command programming module sends over, and carries out out packet according to the agreement of regulation,
And instruction is edited in sequence.
S5, concentrator by instruction set by being wirelessly transmitted to executing agency, in executing agency according to connect entity command compile
The order of connection of journey module successively executes instruction.In the present embodiment, when such as doing flagraising program, inherently one piece of concentrator remote control
Device will start in the remote signal that stop signal is sent, be remotely controlled to flag-raising platform etc., realizes flagraising game.
Entity command programing system in the present embodiment includes following three parts:
First part: entity command programming module, it is a kind of building blocks instruction block
Each module represents one instruction, is combined with block card button, carries out power supply using hardware elastic slice and data are transmitted,
There is a single-chip microcontroller in each module, include program instruction, is responsible for carrying out the judgement of module position, data transmission, instruction
The work such as content record, wake up parameter adjustment.
Second part: being the programming handle as concentrator
Its function includes instruction acquisition, parameter adjustment, instruction three pieces of functions of upload.Itself is a remote controlers for handle, can
The program in execution module (executive device) has been write and downloaded to remote control, operation has been remotely controlled, has number on handle
Display tube, for the parameter in display module, key is used to adjust the parameter in module, and uploads the instruction set of collection.
Part III: program execution module
It is responsible for running the program finished, to embody the function of write program, such as velocity of rotation and the side of motor
To which type of sound played, is combined by these, the structure (such as robot) for controlling execution module can be by
Program requires to work.
The child that the system of the present embodiment can enable study program is not using the tools such as computer, plate, mobile phone,
Also it can be realized programming.Child only need in order combined building block instruct and upload in programming module, can be achieved with to mesh
Mark the control of structure.Make some high-end programmable toys without using tools such as computer, plate, mobile phones, realization can
Programming operation.
The combination of simple entity building blocks instruction, it will be able to realize programming, this threshold that programming can be made to learn substantially reduces,
The age bracket that child learns programming, can drop in application of this final technology on programming teaching aid or programming toy significantly, thus
It really is able to accomplish that programming is done from doll.Specific programming process is as shown in Figure 7.