/* This is modified from the code Blink by Scott Fitzgerald It turns a device connected to a specified pin on and off for set durations repeatedly. */ // the setup function runs once when you press reset or power the board void setup() { // initialize digital pin 1 as an output. pinMode(1, OUTPUT); } // the loop function runs over and over again forever void loop() { digitalWrite(1, HIGH); // activate pin # 1 delay(random(500,1500)); // duration on - vibrate for a random period between 0.5-1.5 sec digitalWrite(1, LOW); // deactivate pin # 1 delay(random(500,1500)); // duration off - turn off vibration for a random period between 0.5-1.5 sec }