This vibration detector switch is OFF in the resting state, when the external force to touch and to achieve a proper vibration meet the appropriate speed or from the (partial) heart, conductive pin will momentarily enable conduction (ON) status, make changes in electric property, and disappear when the external force electric property open (OFF) state is restored.
When there is vibration the Arduino LED on pin 13 flashes.
int Led = 13 ;// define LED Interface int Shock = 10; // define the vibration sensor interface int val; // define numeric variables val void setup () { pinMode (Led, OUTPUT) ; // define LED as output interface pinMode (Shock, INPUT) ; // output interface defines vibration sensor } void loop () { val = digitalRead (Shock) ; // read digital interface is assigned a value of 3 val if (val == HIGH) // When the shock sensor detects a signal, LED flashes { digitalWrite (Led, LOW); } else { digitalWrite (Led, HIGH); } }
Your email address will not be published. Required fields are marked *
Please login to write review!
Looks like there are no reviews yet.