Data wires carry information between programming blocks. Many blocks require that a data wire be attached if the blocks are to function at all. For example, the output from a Random block can only be sent out via a data wire. You create a data wire by “drawing it out” of a block’s data hub. Nearly all of the programming blocks have data hubs and can support data wires. Open a block’s data hub by clicking the tab at the lower left edge of the block after it has been placed on the work area. Note: Sometimes data hubs will not open completely, leaving some plugs hidden. Reveal all of a data hub’s plugs by clicking again on the tab area (as shown in the left image above). You can also close a data hub (or hide any unused plugs not connected to data wires) by clicking the tab area. This will help clean up your work area. The cursor will change shape when it hovers over or is near a data plug. If you then press the mouse button and drag to the right, a data wire will “unroll” that can be connected to a plug on another block’s data hub. To delete a data wire that stretches from left to right between two data plugs, click on the right plug. Data wires carrying information to a block (i.e., carrying input) are connected to the plugs on the left side of its data hub. Data wires carrying information away from a block to another block (i.e., carrying output) are connected to the plugs on the right side. [A] Input plug Each data wire carries a specific type of data between blocks. For example, if a data wire is dragged from a logic plug on a block’s data hub, it can only be connected to a logic plug on another block’s data hub. Data wires are identified with specific colors: If you try to connect a data wire to a plug of the wrong data type, the data wire will be “broken” and colored gray. You will not be able to download your program if it contains broken data wires. If you click on a broken wire you can read why it is broken in the small help window at the lower right corner of the work area. If an input data wire transmits a value outside the possible range of the plug it is connected to, the block will either ignore the value or change it to a value within its range. For plugs that allow just a few input values (example: just 0, 1, or 2), the plug will ignore the input if a value arrives outside its range. For plugs that accept larger input ranges (example: 0 – 100), the plug will force any input outside its range to fit. For example, if a Move block’s Power plug receives an input value of 150, the block will change the input value to 100 (i.e., a number within the Power plug’s range). If an input plug has a corresponding output plug, the input data will pass through from the input plug to the output plug without being changed. In this case, you can only use the output plug if the input plug is connected to an input data wire; connecting an output data wire to such an output plug without a connected input data wire will cause the output data wire to be “broken” and colored gray. The Help file for each programming block contains a chart that shows the different characteristics of the plugs on the block’s data hub. For example, the chart for the Keep Alive block looks like this:Opening data hubs and creating data wires
Drawing out a data wire
Deleting a data wire
Input and output
[B] Output plug
[C] Number data wire (yellow)
[D] Logic data wire (green)
[E] Text data wire (orange)
[F] Broken data wire (gray)Data wires carry specific types of data
Data wire colors
Broken data wires
Data must be within the possible range of the plug
Passing data from the input plug to the output plug
Data Hub chart
Plug Data Type Possible Range What the Values Mean This Plug is Ignored When... Time until sleep Number 0 - 4294967296 Time in milliseconds until the NXT goes to sleep
Tuesday, July 13, 2010
Posted by CikguDin at 8:38 PM 0 comments
Thursday, August 6, 2009
Modul Pembelajaran Terengganu Set 1 Bhgn A&B
ni la ms nak gasak bdk2 ngan soalan2.... gasak je... xpe pas UPSR korang nk main, main lh sepuas hati... cikgu xmarah dh
TRIAL UPSR 2009 MELAKA
Sekolah baru je abis trial... Lambat sket dr negeri2 lain. Tengah cari tial negeri2 lain, harap member yang ada jgn la kedekut sgt :-)... kongsi2 la dgn kwn2..
TRIAL UPSR MELAKA
Posted by CikguDin at 2:19 AM 0 comments
Wednesday, August 5, 2009
Subscribe to:
Posts (Atom)