製作服藥提示器

利用 Wappsto:bit 作為 Remote Control 啟動提示器 , 由家人提醒長者需時服藥。啟動後 , 提示器會發出聲響及燈光 。 長者服藥後可按下 micro:bit (連接Wappsto:bit) 的 A+B button 發送「已服藥」訊息到家人的 smartphone上。
所需材料:
micro:bit v2 x 1 / Speaker
micro:bit x 1
Wappsto:bit x 1
F5 I/O board x 1
LED 燈 x 1
ft 紅綠線 x 2
iPad / Smartphone x 1
電線接駁教學 :

LED 燈 --> F5 I/O board 的P13/P14
編程教學 :
micro:bit A (Wappsto:bit | 發送訊號)
加入「Wappsto」Extension :

按下「Advanced」然後再按「Extensions」

輸入「Wappsto」, 選擇 「wappsto」加入Extension。

在「On start」加入「setup micro:bit on Wappsto with name "Medication Reminder"」
Name是專題的名稱 , 在dashboard上已連接的Wappsto:bit會顯示為這個名字。
「setup String value」的作用是設定 dashboard 要傳送/收集的資料為文字類型 ,
String Value 16 即是dashboard第16組數據 , name "Medication Status" 是該數據類型的名稱 ;
as 「String」則是數據類型 , 可選擇其他類別/單位。
「set radio group 1 」的目的是讓2隻micro:bit進行溝通!

先拖拉出「on String Value received from Wappsto receviedString 」
目的是讓用家能在 smartphone / iPad 上的 Wappsto App (互聯網)發送訊號到 Wappsto:bit ,
從而配合不同 Output Device 運作 , 這次 Wappsto:bit 在收到訊號後會傳送 radio number 。

「 receviedString = " Start " 」 , Start 是在 Wappsto App 裡輸入的文字指令
由於需輸入 string , if = 需使用" " = " " 那組代碼 (string)

send number 1 作用是發送 radio number 至另一塊 micro:bit ( Output)
show icon 則是從micro:bit 顯示編程有否成功 ,
「 send string " System Started" .... 」會在 Dashboard中顯示/改變 Medication Status!

輸入「Stop」會發送另一組訊號(radio send number 2)以Remote形式關上提示器

按下在 Wappsto:bit 上的micro:bit A + B 制亦會發出訊號關上提示器 ,
不同的地方在於這是由長者方手動關上 , 從而表示自己已服藥。
i.e. send string "I've taken medicine!"...
micro:bit B ( F5 I/O board | 接收訊號以控制提示器)

設定為同一個 radio group 以接收數據。

利用 「 on radio received receviedNumber」 接收由 Wappsto:bit 發出的數值 ,
1 是 Wappsto:bit 的「Start」 指令 , 因此發出警報音效及亮起提示燈 (P13 = 1 )
2 是 「Stop」指令或按下 micro:bit A+B , 因此需關上提示器 (P13 = 0 , Stop all sounds)