48. 在 Arduino 藍芽通訊中,下列哪個函數用於從藍芽模組接收數據?
(A) bluetooth.receive()
(B) bluetooth.read()
(C) Serial.receive()
(D) Serial.read()
答案:登入後查看
統計: A(21), B(14), C(6), D(22), E(0) #3252073
統計: A(21), B(14), C(6), D(22), E(0) #3252073
詳解 (共 1 筆)
#6407637
在 Arduino 使用藍牙模組(如 HC-05 或 HC-06)時,這些模組通常透過 串列通訊(Serial Communication) 與 Arduino 溝通。
當藍牙模組接收到資料時,它會經由串列埠傳送給 Arduino,因此你需要使用 Serial.read() 函數來接收資料。
-
(A) bluetooth.receive() → 並不是 Arduino 中的標準函數。
-
(B) bluetooth.read() → 並不是標準函數(除非你有自己定義一個 bluetooth 物件)。
-
(C) Serial.receive() → 並不是正確的 Arduino 函數。
-
✅ (D) Serial.read() → 正確,用於從串列接收單一字元。
0
0