TXT 4.0 Controller 上的 Port 不夠用可以怎樣做?

在大型專題上 , 有機會需要控制多組模型 , 這時候單靠一個 TXT 4.0 Controller 是不足以控制超過8組 Input 及 Output 的。

就此 , 我們可以加入更多的 TXT 4.0 Controller 來接駁不同的 Input 及 Output。(最多接駁9個)

接下來會為大家介紹怎樣接駁更多TXT 4.0 Controller 並如何進行編程。

需多個 TXT Controller 的例子 :

所需材料 :

TXT 4.0 Controller x2

6-pole connector strip x 1

Switch x 1

Motor x 1

Led x 1

使用 6-pole connector strip 接駁 2 個 TXT 4.0 Controller :

把 2 個 TXT 4.0 Controller 接駁至各自的 EXT 1 Port 上。

開啟電源並進行設定 :

同時使用多個 TXT 4.0 Controller 時 , 需將其中一個 Controller 設定成「Master」來執行所有編程內容 ,

其他 Controller 則會作為「Extension」使用 , 「Extension」只需開啟電源便能依靠「Master」操控。

開機後在 Display Screen 左上方的設定欄會有一個 symbol 顯示該Controller是「Master」還是「Extension」

M = 「Master」, 在 ON/OFF button 上的 LED 會是藍色 ;

E = 「Extension」 , 在 ON/OFF button 上的 LED 會是綠色。

「1E」代表 Extension 1 的意思 , 數字用作區分不同的 Extension Controller。

更改 Controller 的 Role (角色) :

選擇「Settings」 > 進入「ROLE」

一個設成「Master」 ; 另一個設成「Extension」, 數字隨意。

Controller Configuration :

取出2個 「TXT 4.0 Controller」

取出第一個後(Master) , 另一個會自己變成 Ext , 選擇相應的編號 : Ext1

在 「Input」取出「Mini switch」 , 「Output」取出「LED」

把 「Mini switch」加至 「Master」的 Input , 「LED」加至「Output」

在「Motor」取出「Motor」 , 然後加至 「Ext1」 的 Motor 上。

連接 TXT 4.0 Master Controller :

詳細的連接方法可查看 : 按此

你只需要在 Robo Pro Coding 連接 Master Controller

電線接駁方法 :

Master Controller :

Switch > I1

LED > O1 O2

Extension Controller :

Motor > M1

專題目標 :

以 Master Controller 控制接駁在自己及Extension Controller 的 Input&Output

編程教學 :

在「Logic」取出「if do else」 , 用作檢測 Swicth 並控制 Motor 及 LED

在「Input」取出「is mini switch open」

將「if do else」加入至 forever loop (無間斷地檢測 SWITCH 有沒有被按下) ,

然後加入「is mini switch closed」 (改成 closed) , 意思是按下時做出Output(do)

在 「Output」取出2個「set LED __ on」

按下 Switch 時 (closed) 開啟 LED (set LED on) ; 否則 (else 沒按下時)關上 LED (set LED off)

在「Motor」取出「set motor speed」及「stop motor」

按下 Siwtch 時 (closed) 開啟 Motor (512) ; 否則 (else 沒按下時)關上 Motor (0)

Motor 的 speed 數值為 0 - 512 ; 0 代表關上 , 512 則是最高速度

緊記選擇相應的 Controller > E1 (Extension Controller 1)

按下「start program」傳送並啟動編程

傳送編程後 , 按下 Switch 看看會發生什麼事情

影片示範 :