vibration sensor module SW-420 -- TZT normally closed type

TZT normally closed type vibration sensor module Alarm sensor module Vibration switch SW-420 for arduino


22 ₪



Vibration Sensor Module (SW-420) to arduino

دائرة التوصيل



الكود البرمجي

code
نسخ
اقتباس
عرض
تنزيل
	
								
// Define the pin numbers for Vibration Sensor const int sensorPin = 7; void setup() { Serial.begin(9600); // Start serial communication at 9600 baud rate pinMode(sensorPin, INPUT); // Set the sensorPin as an input pin } void loop() { if (digitalRead(sensorPin)) { // Check if there is any vibration detected by the sensor Serial.println("Detected vibration..."); // Print "Detected vibration..." if vibration detected } else { Serial.println("..."); // Print "..." other wise } // Add a delay to avoid flooding the serial monitor delay(100); }


سلة المشتريات افراغ السلة