| Electronic Components Datasheet Search |
|
DFR0440 Datasheet(PDF) 4 Page - DFROBOT |
|
|
|||||||||||||||||||||||||||||
DFR0440 Datasheet(HTML) 4 Page - DFROBOT |
|
4 / 6 page ![]() * @version V1.0 * @date 2016-5-26 * All above must be included in any redistribution * ****************************************************/ const int buttonPin = 8; // the number of the pushbutton pin const int VibPin = 11; // the number of the Vibration Module pin int key=0; void setup() { pinMode(VibPin,OUTPUT); // Set the digital pin(11) as output pinMode(buttonPin, INPUT); // Set the digital pin(8) as input } void loop() { key=digitalRead(buttonPin); if(key==LOW) { digitalWrite(VibPin,HIGH); //Turn on the Vibration Mod ule delay(5000); //Waits for 5 seconds digitalWrite(VibPin,LOW); //Turn off the Vibration Modu le } else digitalWrite(VibPin,LOW); //Turn off the Vibration Module // put your main code here, to run repeatedly: } Results: when the button of pin 8 is pressed, the vibration module will be on for 5 seconds, then stop and wait for the button to be pushed again |
|
|
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 |