
滾珠開關模組商品簡介
滾珠開關模組,數位訊號類型感測器,搖晃模組使內部滾珠碰觸到接觸點即可收到觸發訊號,大多應用在手勢搖晃或是偵測震動類的相關主題,可製作地震頻率偵測器、搖晃警示器與手勢操控設備的主題。

範例說明
本範例使用 Arduino Uno Rev3(原裝) ,連接Circus 滾珠開關模組,因為此為數位訊號模組,連接時請選擇可以輸入數位訊號的腳位連接,本範例中的訊號腳位設為 「D5」。
使用設備
接線圖

商品規格
感測器類型 | 數位訊號 |
連接電壓 | 3.3V ~ 5V |
主要元件 | SW-200D |
範例程式連結
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define ballSwitch 5 | |
void setup() { | |
Serial.begin(9600); | |
pinMode(ballSwitch, INPUT); | |
} | |
void loop() { | |
Serial.println(digitalRead(ballSwitch)); | |
} |