Button的作用是作為一個基本按鈕,會傳送出True/False的數值,在編程中擔當True/False Input的Block。當Button被按下時,通常會連帶觸發Output。
Button x1
RGB LED x1
Workbench Coding 網頁 : 請按我
如有配對上的問題請查看 : Tutorial 0. Connect SAM blocks and micro:bit On Workbench
配對後按下右上角的計時器可以看到 Button 的詳細數據 ,
按下 Button 時為 Pressed , 沒被按下時為 Released。
1. 把 RGB LED 也配對至workbench平台。
當 Button 被按下時 RGB LED 便會開啟 , 而當 Button 沒被按下/放開時 RGB LED 便關閉。
1.在「Button」的「Events」中把 「when Button is pressed 」拖拉至workspace 2次。
2.把其中一個改成「released」
3.在 RGB Light 中取出「set RGB LED Light LED color to ___ 」及「turn RGB Light LED off」 , 並把它們加至2個 「when button」的裡面。