KY-002 Sensor De Vibração Sw-420
R$ 37,50
Em estoque (pode ser encomendado)
Camila / Dúvidas sobre o produto? Precisa de ajuda? Fale comigo.Descrição
The Vibration module is connect to pin 10 of the ArduinoConnecting to the ArduinoPin – = GND, connect to GND of the ArduinoPin (middel pin) +5 v, connect to Arduino +5Pin S signal, connect to Arduino pin 10When there is vibration the Arduino LED on pin 13 flashes.———————————————————————–Example code———————————————————————-int Led = 13 ;// define LED Interfaceint Shock = 10; // define the vibration sensor interfaceint val; // define numeric variables valvoid 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); }}
Informação adicional
Peso | 0,0000 kg |
---|---|
Dimensões | 0,0000 × 0,0000 cm |