| Electronic Components Datasheet Search |
|
DFR0027 Datasheet(PDF) 4 Page - DFROBOT |
|
|
|||||||||||||||||||||||||||||
DFR0027 Datasheet(HTML) 4 Page - DFROBOT |
|
4 / 4 page ![]() 2 //Connect the sensor to digital Pin 3 which is Interr upts 1. 3 #define SensorINPUT 3 4 5 unsigned char state = 0; 6 7 void setup() { 8 pinMode(SensorLED, OUTPUT); 9 pinMode(SensorINPUT, INPUT); 10 //Trigger the blink function when the falling edge is detected 11 attachInterrupt(1, blink, FALLING); 12 } 13 14 void loop() { 15 if (state != 0) { 16 state = 0; 17 digitalWrite(SensorLED, HIGH); 18 delay(500); 19 } 20 else 21 digitalWrite(SensorLED, LOW); 22 } 23 24 //Interrupts function 25 void blink() { 26 state++; 27 } Result As shown in figure connection , plug LED and lay a finger on Digital Vibration Sensor , LED will be lightened Trouble shooting More question and cool idea, visit DFRobot Forum Powered By DFRobot © 2008-2017 |
|
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |