Loop Block Icon of block

迴圈指令


Loop Block

Use this block to repeat sequences of code. Set the condition that will end the loop: elapsed time, the number of repetitions, a logic signal or a sensor. You can also set a loop to go on forever.

顯示設定 Display settings

增加指令 Adding blocks to the Loop block

移動 Moving the Loop block

設定 Configuring the Loop block

顯示設定
Display settings

image of Loop block, empty when dragged from palette; infinity symbol marked with number 1

Image of Loop block, containing a motor block and set for light sensor conditional; counter marked with number 2; sensor icon marked with number 3

  1. 迴圈指令設定為"永遠"時,在指令圖示的下方會出現無限的符號(∞).
    When a Loop block’s action property is set to “Forever,” an infinity symbol (∞) is displayed at the bottom of the trailing portion of the block.
  2. 勾選參數面板的"顯示計數器"選項時,會出現連接埠的圖示,就可以用現已完成的迴圈執行次數來當作其他地方的輸入值(如果有資料線連結這個連接埠跟其他的資料集線器). 也可以用現有的次數來控制迴圈.(參閱下列的設定執行次數說明)
    If the “Show Counter” checkbox is selected in the configuration panel, a plug will appear that will allow you to use the number of completed loops as an input elsewhere in your program (if you connect a data wire from the plug to another block’s data hub). You can also use current count to control the loop itself. (See the Count setting in the Configuring the Loop Block section below).
  3. 如果用感應器來控制迴圈,那麼會在迴圈指令的下方出現所選感應器的圖示.例如,選用光源感應器來控制迴圈,在指令的延伸部分就會出現光源感應器圖示.並且任何有關該感應器的訊息也會出現在指令下方.
    If you choose for a sensor to control the loop, the trailing portion of the Loop block will expand in size revealing an icon for the chosen sensor. For example, if you choose a Light Sensor to control the loop, a Light Sensor icon will be displayed in the expanded portion of the block. Also, any relevant information about the chosen control property will displayed at the bottom of the block.

增加指令
Adding blocks to the Loop block

如果迴圈指令放在序列軸上,在迴圈指令的內部會出現一小段的序列軸.拖曳程式指令到這個區域會自動對齊到序列軸上.當迴圈指令裡已經有程式指令時,當有新的指令加入,迴圈指令外框會向側邊延伸而讓新指令有足夠的空間可以對齊到序列軸上.
If a Loop block is placed on the sequence beam, a short section of the beam will appear inside the Loop block; programming blocks dragged on top of this portion of the sequence beam will snap to it. Any new blocks dragged inside a loop that already contains programming blocks will cause the frame to expand sideways. This will make room for the new blocks to snap to the sequence beam.

移動
Moving the Loop block

點選迴圈指令本身才可以選取或是移動指令,單是點選外框是無法移動指令.
The Loop block can only be selected and moved by clicking on the block itself; clicking on the surrounding frame or on the blocks inside the frame will not work.

設定
Configuring the Loop Block

設定參數的下拉式選單提供五種主要的設定參數:
The Control property pull-down menu will let you choose from five primary conditions that will affect your loop:

永遠
Forever

Image of configuration pane for the Loop block, set to Forever

選擇"永遠"時,在迴圈指令裡的程式指令會一直不斷地執行.
If you choose “Forever,” any programming blocks within the loop will repeat forever without interruption.

  1. 勾選"顯示計數器"ˇ選項可以用現在迴圈的已執行次數來當作其他指令的輸入值.(例如,增加馬達指令的動力).
    Check the “Show Counter” checkbox to use the number of loops completed as input to another block. (Example: to increase a Motor block’s Power.)

執行時間
Time

Image of configuration pane for the Loop block, set to Time

選擇"執行時間"會讓迴圈在指令的秒數內執行,當時間一到,迴圈則停止執行.
If you choose “Time,” the programming blocks within the loop will repeat until a certain number of seconds have passed. After the time period is up, the loop will end.

  1. 在此欄位內輸入迴圈應該的執行秒數.如輸入五秒,則迴圈會在五秒過後停止.
    Use this box to type in the number of seconds that the loop should run. If you choose 5 seconds, for example, the loop will end after 5 seconds have passed.
  2. 勾選參數面板的"顯示計數器"選項時,會出現連接埠的圖示,就可以用現已完成的迴圈執行次數來當作其他地方的輸入值(如果有資料線連結這個連接埠跟其他的資料集線器)
    If the “Show Counter” checkbox is selected in the configuration panel, a plug will appear that will allow you to use the number of completed loops as an input elsewhere in your program (if you connect a data wire from the plug to another block’s data hub).

觸控感應器
Touch Sensor

Image of configuration pane for the Loop block, set to Touch Sensor

選擇觸控感應器時,在迴圈內的指令會在觸控感應器被觸碰,按下或放開前執行.此時迴圈就會停止再繼續執行其他的程式.
If you choose “Touch Sensor,” the programming blocks within the loop will repeat until a touch sensor is bumped, pressed, or released. Then the loop will end and the program will go on.

  1. 選擇觸控感應器所連接的輸入端.
    Choose the port that the touch sensor is connected to.
  2. 指定觸控感應器的狀態: 觸碰, 按下, 或是放開來停止迴圈.觸碰指的是感應器被快速地按下與放開(在0.5秒內完成動作)的狀態.按下指的是感應器當時被按下的狀態.放開指的是感應器當時放開的狀態.
    Use the radio buttons to specify whether you want the touch sensor to be bumped, pressed, or released to end the loop. Choose Bumped if you want the block to be triggered after a quick press and release of the touch sensor (less than 0.5 seconds in duration). Choose Pressed if you want the block to be triggered at the instant the touch sensor is pressed in. Choose Released if you want the block to be triggered at the instant the touch sensor is released.
  3. 回饋區可以用來測試觸控感應器.當機器人上的感應器作用時,就會顯示出數字"1".可以用重置按鍵來清除回饋顯示.
    The feedback box will let you test your touch sensor. When the sensor is activated on your robot, the number “1” will be displayed here. Use the reset button to clear the feedback box.
  4. 勾選參數面板的"顯示計數器"選項時,會出現連接埠的圖示,就可以用現已完成的迴圈執行次數來當作其他地方的輸入值(如果有資料線連結這個連接埠跟其他的資料集線器)
    If the “Show Counter” checkbox is selected in the configuration panel, a plug will appear that will allow you to use the number of completed loops as an input elsewhere in your program (if you connect a data wire from the plug to another block’s data hub).

聲控感應器
Sound Sensor

Image of configuration pane for the Loop block, set to Sound Sensor

選用聲控感應器,表示迴圈內的程式會在到達某個範圍的音量前一直執行.
If you choose “Sound Sensor,” the programming blocks within the loop will repeat until the sound sensor detects sound in a certain range.

  1. 選擇聲控感應器所連接的輸入端. 預設值為2號輸入端.
    Choose the port where your sound sensor is plugged in. By default, the block will be set to port 2 for a sound sensor.
  2. 使用滑桿來設定執行數值或是直接輸入數值.點選滑桿右邊的單一選項表示音量高過數值時,迴圈即停止執行.點選左邊的選項則表示在音量低於數值時,迴圈就停止.也可以使用下拉式選單來設定滑桿控制器的比例來結束迴圈.
    Use the slider to set the trigger value or type a value directly into the input box. Select the radio button to the right of the slider if you want the loop to end when sound levels are higher than the trigger value; select the left radio button to end the loop when sound levels are lower than the trigger value. You can also use the pull-down menu to set the portion of the slider that will end the loop.
  3. 回饋區用來顯示現在讀取到的音量大小(0~100%).也可以用來測試不同的執行數值.
    The feedback box displays the current sound reading (0-100%). You can use it to try out different trigger values.
  4. 勾選參數面板的"顯示計數器"選項時,會出現連接埠的圖示,就可以用現已完成的迴圈執行次數來當作其他地方的輸入值(如果有資料線連結這個連接埠跟其他的資料集線器)
    If the “Show Counter” checkbox is selected in the configuration panel, a plug will appear that will allow you to use the number of completed loops as an input elsewhere in your program (if you connect a data wire from the plug to another block’s data hub).

光源感應器
Light Sensor

Image of configuration pane for the Loop block, set to Light Sensor

選用光源感應器,表示在迴圈內的程式在感應器接收到某個光度值前不斷地執行,之後再停止迴圈,繼續接續的程式.
If you choose “Light Sensor,” the programming blocks within the loop will repeat until a light sensor measures a certain intensity of light. Then the loop will end and the program will advance.

  1. 選擇光源感應器所連接的輸入端. 預設值為3號輸入端.
    Choose the port where your light sensor is plugged in. By default, the block will be set to port 3 for a light sensor.
  2. 使用滑桿來設定執行數值或是直接輸入數值.點選滑桿右邊的單一選項表示受光量高過數值時,迴圈即停止執行.點選左邊的選項則表示在受光量低於數值時,迴圈就停止.也可以使用下拉式選單來設定滑桿控制器的比例來結束迴圈.
    Use the slider to set the trigger value or type a value directly into the input box. Select the radio button to the right of the slider if you want the loop to end when light levels are higher than the trigger value; select the left radio button to end the loop when light levels are lower than the trigger value. You can also use the pull-down menu to set the portion of the slider that will end the loop.
  3. 當勾選"產生光源"選項時,光源感應器會打開自身的光源,並偵測該光源是反射到感應器上
    If you check the “Generated Light” checkbox, the light sensor will turn on its own small light source and detect this light if it is reflected back to it.
  4. 回饋區顯示現在讀取到的光量值.
    The feedback box will display the current light reading.
  5. 勾選參數面板的"顯示計數器"選項時,會出現連接埠的圖示,就可以用現已完成的迴圈執行次數來當作其他地方的輸入值(如果有資料線連結這個連接埠跟其他的資料集線器)
    If the “Show Counter” checkbox is selected in the configuration panel, a plug will appear that will allow you to use the number of completed loops as an input elsewhere in your program (if you connect a data wire from the plug to another block’s data hub).

超音波感應器
Ultrasonic Sensor

Image of configuration pane for the Loop block, set to Ultrasonic Sensor

選用超音波感應器,表示在迴圈內的程式在感應器偵測到某個距離前會不斷地執行.
If you choose “Ultrasonic Sensor,” the programming blocks within the loop will repeat until the ultrasonic sensor detects an object at a certain distance.

  1. 選擇超音波感應器所連接的輸入端. 預設值為4號輸入端.
    Choose the port where your ultrasonic sensor is plugged in. By default, the block will be set to port 4 for an ultrasonic sensor.
  2. 使用滑桿來設定執行數值或是直接輸入數值.點選滑桿左邊的單一選項表示當距離短於設定值時,迴圈即停止執行.點選右邊的選項則表示在距離遠於設定值時,迴圈就停止.也可以使用下拉式選單來設定滑桿控制器的比例來結束迴圈.
    Use the slider to set the trigger value or type a value directly into the input box. Select the radio button to the left of the slider if you want the loop to end when the ultrasonic sensor detects an object closer than the trigger value; select the right radio button to end the loop when the ultrasonic sensor detects an object farther away than the trigger value. You can also use the pull-down menu to set the portion of the slider that will end the loop.
  3. 選擇公分或是英吋來當距離單位.
    Select to read values in Centimeters or Inches.
  4. 回饋區顯示現在超音波感應器所讀到的數據.
    The feedback box will display the current ultrasonic sensor reading.
  5. 勾選參數面板的"顯示計數器"選項時,會出現連接埠的圖示,就可以用現已完成的迴圈執行次數來當作其他地方的輸入值(如果有資料線連結這個連接埠跟其他的資料集線器)
    If the “Show Counter” checkbox is selected in the configuration panel, a plug will appear that will allow you to use the number of completed loops as an input elsewhere in your program (if you connect a data wire from the plug to another block’s data hub).

NXT按鈕
NXT Buttons

Image of configuration pane for the Loop block, set to NXT Buttons

選擇NXT按鍵時,在迴圈內的指令會在所選定的NXT按鍵被觸碰,按下或放開前一直執行.
If you choose “NXT Buttons,” the programming blocks within the loop will repeat until the chosen NXT buttons is bumped, pressed, or released.

  1. 被選定的NXT按鍵會作用時(終止迴圈時)傳送"真"值.
    Select which NXT button will send out a “true” signal when activated (and end the loop).
  2. 觸碰指的是該按鍵被快速地按下與放開的狀態.按下指的是該按鍵當時被按下的狀態.放開指的是該按鍵當時放開的狀態.
    Choose Bumped if you want the chosen button to be activated after a quick press and release. Choose Pressed if you want the chosen button to be activated at the instant the button is pressed in. Choose Released if you want the chosen button to be activated at the instant the button is released.
  3. 當所選定的按鍵被觸碰,按下或放開時在回饋區會顯示數字"1".
    The feedback box will display a “1” when the chosen NXT button is bumped, pressed or released (according to the configuration you’ve set).
  4. 勾選參數面板的"顯示計數器"選項時,會出現連接埠的圖示,就可以用現已完成的迴圈執行次數來當作其他地方的輸入值(如果有資料線連結這個連接埠跟其他的資料集線器)
    If the “Show Counter” checkbox is selected in the configuration panel, a plug will appear that will allow you to use the number of completed loops as an input elsewhere in your program (if you connect a data wire from the plug to another block’s data hub).

(內建)角度感應器
(Built-in) Rotation Sensor

Image of configuration pane for the Loop block, set to Built-in Rotation Sensor

讀取角度感應器的值表示在感應器到達一定的數值前,迴圈裡的程式會不斷地執行. 之後迴圈就會停止並繼續以後的程式.如果使用"歸零"指令,那麼在每次迴圈執行完後都會將數值歸零.也就是說迴圈會執行直到在某次的迴圈中達到設定值時才會停止.
If you choose to “read” a rotation sensor, the programming blocks within the loop will repeat until the rotation sensor reaches a certain value; then the loop will end and the program will advance. If you choose to “reset” the rotation sensor, the sensor will be reset to zero after each loop; the block will continue to loop until the rotation sensor can reach the trigger value during one of the loops.

  1. 選澤馬達連接的輸入端.
    Choose the port where your motor is plugged in.
  2. 選擇讀取角度感應器或是歸零.
    Choose to read or reset a rotation sensor.
  3. 使用單選按鈕來設定偵測的方向: 前轉或後轉.
    Use the radio buttons to set the direction you want: forwards or backwards.
  4. 用下拉式選單來選擇旋轉圈數或是角度.
    Choose to count either Rotations or Degrees by using the pull-down menu.
  5. 輸入在迴圈結束前,所要旋轉的圈數與角度(讓程式可以向前進).
    Type the number of rotations or degrees you want to go by before the loop is ended (allowing your program to go forward).
  6. 回饋區顯示現在的圈數或是角度值.使用歸零按鍵來清除回饋區資料.
    The feedback box will display the current number of rotations or degrees. Use the reset button to clear the feedback box.
  7. 勾選參數面板的"顯示計數器"選項時,會出現連接埠的圖示,就可以用現已完成的迴圈執行次數來當作其他地方的輸入值(如果有資料線連結這個連接埠跟其他的資料集線器)
    If the “Show Counter” checkbox is selected in the configuration panel, a plug will appear that will allow you to use the number of completed loops as an input elsewhere in your program (if you connect a data wire from the plug to another block’s data hub).

計時器
Timer

Image of configuration pane for the Loop block, set to Timer

讀取計時器表示會使用NXT本身的計時器來決定迴圈的停止, 如果使用"歸零"指令,那麼在每次迴圈執行完後都會將數值歸零.也就是說迴圈會執行直到在某次的迴圈中達到設定值時才會停止.
If you choose to “read” a timer, the programming blocks within the loop will repeat until one of the NXT’s internal timers reaches a certain time value; then the loop will end and the program will advance. If you choose to “reset” a timer, the timer will be reset after each loop; the block will continue to loop until the timer can reach its trigger value during one of the loops.

  1. 選澤NXT計時器.
    Choose the NXT timer that you would like to monitor.
  2. 選擇讀取計時器或是歸零.
    Choose to read or reset a timer.
  3. 在欄位中輸入時間值(秒數).
    Type a time value (in seconds) in the input box.
  4. 勾選參數面板的"顯示計數器"選項時,會出現連接埠的圖示,就可以用現已完成的迴圈執行次數來當作其他地方的輸入值(如果有資料線連結這個連接埠跟其他的資料集線器)
    If the “Show Counter” checkbox is selected in the configuration panel, a plug will appear that will allow you to use the number of completed loops as an input elsewhere in your program (if you connect a data wire from the plug to another block’s data hub).

接收訊息
Receive Message

Image of configuration pane for the Loop block, set to Receive Message

選擇接收訊息表示迴圈裡的程式會在NXT接受藍芽訊號前一直執行.之後在停止迴圈並繼續往後的程式.
If you choose “Receive Message,” the programming blocks within the loop will repeat until your NXT receives a certain Bluetooth message. Then the loop will end and the program will advance.

  1. 透過下拉式選單可以選擇訊息類型(文字,數字,或邏輯訊號).
    The pull-down menu will let you select the message type (Text, Number, or Logic) of the message that you expect to receive.
  2. 要比較接收到的訊息,得在文字或數字欄位裡分別輸入符合格式的資料.或是使用單選按鍵來做邏輯訊號的比較(真/偽).
    To compare the incoming message to a test message, either type in the test text or number (if you have chosen Text or Number respectively as the format), or use the radio buttons to choose the test logic value (true or false).
  3. 選擇用來接收訊號的郵箱號碼.
    Choose the mailbox number where the incoming message will arrive.
  4. 勾選參數面板的"顯示計數器"選項時,會出現連接埠的圖示,就可以用現已完成的迴圈執行次數來當作其他地方的輸入值(如果有資料線連結這個連接埠跟其他的資料集線器)
    If the “Show Counter” checkbox is selected in the configuration panel, a plug will appear that will allow you to use the number of completed loops as an input elsewhere in your program (if you connect a data wire from the plug to another block’s data hub).

觸控*感應器
Touch* Sensor

Image of configuration pane for the Loop block, set to old Touch* Sensor – callouts 1-3

選擇觸控*感應器時,在迴圈內的指令會在觸控*感應器被觸碰,按下或放開前執行.此時迴圈就會停止再繼續執行其他的程式.
If you choose “Touch* Sensor,” the programming blocks within the loop will repeat until a touch* sensor is bumped, pressed, or released. Then the loop will end and the program will go on.

  1. 選擇觸控*感應器所連接的輸入端. 預設值為1號輸入端.
    Choose the port that the touch* sensor is connected to. By default, the block will be set to port 1 for a touch sensor.
  2. 指定觸控感應器的狀態: 觸碰, 按下, 或是放開來停止迴圈.觸碰指的是感應器被快速地按下與放開(在0.5秒內完成動作)的狀態.按下指的是感應器當時被按下的狀態.放開指的是感應器當時放開的狀態.
    Use the radio buttons to specify whether you want the touch sensor to be bumped, pressed, or released to end the loop. Choose Bumped if you want the block to be triggered after a quick press and release of the touch sensor (less than 0.5 seconds in duration). Choose Pressed if you want the block to be triggered at the instant the touch sensor is pressed in. Choose Released if you want the block to be triggered at the instant the touch sensor is released.
  3. 回饋區可以用來測試觸控感應器.當機器人上的感應器作用時,就會顯示出數字"1".可以用重置按鍵來清除回饋顯示.
    The feedback box will let you test your touch sensor. When the sensor is activated on your robot, the number “1” will be displayed here. Use the reset button to clear the feedback box.
  4. 勾選參數面板的"顯示計數器"選項時,會出現連接埠的圖示,就可以用現已完成的迴圈執行次數來當作其他地方的輸入值(如果有資料線連結這個連接埠跟其他的資料集線器)
    If the “Show Counter” checkbox is selected in the configuration panel, a plug will appear that will allow you to use the number of completed loops as an input elsewhere in your program (if you connect a data wire from the plug to another block’s data hub).

光源*感應器
Light* Sensor

Image of configuration pane for the Loop block, set to old Light* Sensor – callouts 1-3

選用光源*感應器,表示在迴圈內的程式在感應器接收到某個光度值前不斷地執行,之後再停止迴圈,繼續接續的程式.
IIf you choose “Light* Sensor,” the programming blocks within the loop will repeat until a light* sensor measures a certain intensity of light. Then the loop will end and the program will advance.

  1. 選擇光源感應器所連接的輸入端. 預設值為3號輸入端.
    Choose the port where your light* sensor is plugged in. By default, the block will be set to port 3 for a light sensor.
  2. 使用滑桿來設定執行數值或是直接輸入數值.點選滑桿右邊的單一選項表示受光量高過數值時,迴圈即停止執行.點選左邊的選項則表示在受光量低於數值時,迴圈就停止.也可以使用下拉式選單來設定滑桿控制器的比例來結束迴圈.
    Use the slider to set the trigger value or type a value directly into the input box. Select the radio button to the right of the slider if you want the loop to end when light levels are higher than the trigger value; select the left radio button to end the loop when light levels are lower than the trigger value. You can also use the pull-down menu to set the portion of the slider that will end the loop.
  3. 回饋區顯示現在讀取到的光量值.
    The feedback box will display the current light reading.
  4. 勾選參數面板的"顯示計數器"選項時,會出現連接埠的圖示,就可以用現已完成的迴圈執行次數來當作其他地方的輸入值(如果有資料線連結這個連接埠跟其他的資料集線器)
    If the “Show Counter” checkbox is selected in the configuration panel, a plug will appear that will allow you to use the number of completed loops as an input elsewhere in your program (if you connect a data wire from the plug to another block’s data hub).

角度*感應器
Rotation* Sensor

Image of configuration pane for the Loop block, set to old Rotation* Sensor – callouts 1-6

讀取角度*感應器的值表示在感應器到達一定的滴答數前(一圈為16個滴答數),迴圈裡的程式會不斷地執行. 之後迴圈就會停止並繼續以後的程式.如果使用"歸零"指令,那麼在每次迴圈執行完後都會將數值歸零.也就是說迴圈會執行直到在某次的迴圈中達到設定值時才會停止.
If you choose to “read” a rotation* sensor, the programming blocks within the loop will repeat until the rotation sensor reaches a set number of ticks (16 to a rotation); then the loop will end and the program will advance. If you choose to “reset” the rotation* sensor, the sensor will be reset to zero after each loop; the block will continue to loop until the rotation* sensor can reach the trigger value during one of the loops.

  1. 選澤馬達連接的輸入端.
    Choose the port where your motor is plugged in.
  2. 選擇讀取角度*感應器或是歸零.
    Choose to read or reset a rotation* sensor.
  3. 使用單選按鈕來設定偵測的方向: 前轉或後轉.
    Use the radio buttons to set the direction you want: forwards or backwards.
  4. 輸入在迴圈結束前,所要的滴答數值(一圈為16個滴答數)(讓程式可以向前進).Type the number of ticks (16 to a rotation) you want to go by before the loop is ended (allowing your program to go forward).
  5. 回饋區顯示現在的滴答數值.使用歸零按鍵來清除回饋區資料.
    The feedback box will display the current number of ticks (16 to a rotation). Use the reset button to clear the feedback box.
  6. 勾選參數面板的"顯示計數器"選項時,會出現連接埠的圖示,就可以用現已完成的迴圈執行次數來當作其他地方的輸入值(如果有資料線連結這個連接埠跟其他的資料集線器)
    If the “Show Counter” checkbox is selected in the configuration panel, a plug will appear that will allow you to use the number of completed loops as an input elsewhere in your program (if you connect a data wire from the plug to another block’s data hub).

溫度*感應器
Temperature* Sensor

Image of configuration panel for the Loop block, set to Temperature* Sensor – callouts 1-5

選用溫度*感應器,表示在迴圈內的程式在感應器測量到某個溫度時前將不斷地執行,之後再停止迴圈,繼續接續的程式.
If you choose “Temperature* Sensor,” the programming blocks within the loop will repeat until a temperature* sensor measures a certain temperature. Then the loop will end and the program will advance.

  1. 選擇溫度*感應器所連接的輸入端. 預設值為4號輸入端.
    Choose the port where the temperature sensor is plugged in. By default, the block will be set to port 4 for a temperature sensor.
  2. 使用滑桿來設定執行數值或是直接輸入數值.點選滑桿右邊的單一選項表示受溫度高過數值時,迴圈即停止執行.點選左邊的選項則表示在溫度低於數值時,迴圈就停止.也可以使用下拉式選單來設定滑桿控制器的比例來結束迴圈.
    Use the slider to set the trigger value or type a value directly into the input box. Select the radio button to the right of the slider if you want the block to be triggered by temperatures higher than the trigger value; select the left radio button to trigger the block with temperatures lower than the trigger value. You can also use the pull-down menu to set the “true” portion of the slider.
  3. 選擇攝氏或是華式來當溫度單位.
    Select to read values in Celsius or Fahrenheit.
  4. 回饋區顯示現在感應器所讀到的溫度.
    The feedback box displays the current temperature reading.
  5. 勾選參數面板的"顯示計數器"選項時,會出現連接埠的圖示,就可以用現已完成的迴圈執行次數來當作其他地方的輸入值(如果有資料線連結這個連接埠跟其他的資料集線器)
    If the “Show Counter” checkbox is selected in the configuration panel, a plug will appear that will allow you to use the number of completed loops as an input elsewhere in your program (if you connect a data wire from the plug to another block’s data hub).

計數
Count

Image of configuration pane for the Loop block, set to Count

選擇計數表示迴圈裡的程式會在計數器到達數值前不斷地執行.
If you choose “Count,” any programming blocks within the loop will repeat until the Counter reaches a set number of repetitions.

  1. 輸入執行迴圈的次數.如果輸入2,則迴圈會在執行兩次指令後停止.
    Use this box to type in the number of repetitions that will end the loop. If you type “2,” for example, the loop will end after the programming blocks in the loop have been run twice.
  2. 勾選"顯示計數器",便可以從迴圈的左方拉出資料線到右方(連接埠出現的地方).當左右兩邊都連結時,此程式就可以計算出完成迴圈的次數,並在達到設定的次數後離開迴圈.
    Check the “Show Counter” checkbox so that you can wire the left side of the loop to the right side (where the “count” plug appeared). With the left and right sides connected, the program will be able to count the number of completed loops and leave the loop when the count reaches the number you set.

邏輯
Logic

Image of configuration pane for the Loop block, set to Logic

選擇"邏輯"並連結資料線到迴圈指令的延伸部分,即表示迴圈內的程式指令會在接收到由資料線傳來的邏輯訊號前重複執行.當接收到特定的邏輯訊號,迴圈才會停止.
If you choose “Logic” and connect an input data wire to the Loop block’s trailing portion, any programming blocks within the loop will repeat as long as the Loop block is receiving a true or false logic signal through the data wire. When a specified logic signal is received, the loop will end.

  1. 選擇哪種邏輯訊號來停止迴圈的運作.
    Choose which type of logic signal, true or false, will end the loop.
  2. 勾選參數面板的"顯示計數器"選項時,會出現連接埠的圖示,就可以用現已完成的迴圈執行次數來當作其他地方的輸入值(如果有資料線連結這個連接埠跟其他的資料集線器)
    If the “Show Counter” checkbox is selected in the configuration panel, a plug will appear that will allow you to use the number of completed loops as an input elsewhere in your program (if you connect a data wire from the plug to another block’s data hub).