Saturday , October 20 2018
Home / DIY VIDEOS / Zen Blaster; a Most Annoying DIY Electronic Device

Zen Blaster; a Most Annoying DIY Electronic Device

I build a little gadget to prank my lovely wife. WARNING! THIS DRIVES PEOPLE NUTS! DON’T DO IT TO SOMEONE WHO IS LIKELY TO PUNCH YOU IN THE FACE.
Makes annoying beeps at random intervals. The random pitch and interval makes it very difficult to pin-point the source of the beeping. I might clean up the design and spin up a few circuit boards if anybody is interested in an easy build-along vid.
Thanks for your help!

Here’s the code:
/*
Lil’ BASTARD ZEN BLASTER
WARNING! THIS DRIVES PEOPLE NUTS! DON’T DO IT TO ANYBODY WHO IS LIKELY TO PUNCH YOU IN THE FACE.
Makes annoying beeps at random intervals. The random pitch and interval makes it very difficult to pin-point the source of the beeping.

*/
const int speaker = P1_7; // this sets the pin on the MSP430 that sends a beep to the speaker.
int duration = 1000; // this is a variable that stores the value of length of the tone
int frequency = 600; // this is a variable that stores the value of the frequency of the tone
int counter = 0; // this is a variable that stores the value of how many times we’ve run thru the void loop
int trigger = 1; // this is a variable that stores how many times we run thru the void loop prior to triggering a beep sequence
int beeps = 2; // this is a variable that stores how many beeps in a sequence

// the setup routine runs once when you press reset:
void setup() {

tone(P1_7, 2500, 800);
delay (200);
tone(P1_7, 500, 800);
delay (200);
tone(P1_7, 2500, 800);
delay (200);
// this runs through a few tones when you first start to let you know it’s working.

}

// the loop routine runs over and over again forever:
void loop() {

counter = counter ++; // each time through the program, we add 1 to the value of counter
if ( trigger == counter && beeps == 2) { // if the trigger value and the counter value are equal AND the beep value is 2 then do this:
counter = 0; // resets the counter value to zero
beeps = random (2, 5); // sets the number of beeps for the next time

 trigger = random (500, 5000); // sets the length of time before the next series of beeps
 duration = random (200, 2000); // sets the length of time for each beep in milliseconds 
  frequency = random (2500, 6000); // sets the frequency in Hertz of the square wave signal to the speaker
  tone (speaker, frequency, duration); // sends a beep square wave signal to the speaker according to the values of frequency and duration
        delay (duration/2); // sets a short delay pause to allow the beep prior to executing the next command
  duration = random (400, 1500);
 frequency = random (300, 4000);
tone (speaker, frequency, duration);
delay (duration/2); 
}
if ( trigger == counter && beeps == 3) {
counter = 0;
beeps = random (2, 5);
    trigger = random (500, 5000);
 duration = random (200, 2000);
  frequency = random (2500, 6000);
  tone (speaker, frequency, duration);
  delay (duration/2);
  duration = random (500, 2000);
 frequency = random (300, 1500);
tone (speaker, frequency, duration);
delay (duration/2); 
 duration = random (1500, 2000);
 frequency = random (300, 3000);
tone (speaker, frequency, duration);
delay (duration/2); 
}

Continued in comments. (it’s too long for description).

About admin

Check Also

Diy Elegant Crystal Lighting| Simple, Quick and Inexpensive Home Decor Essentials!

This is a Diy video that shows How Quick and Easy it is to make …

Barbie Goes School Supply Shopping DIY Miniature Supplies Supermarket diy Toy House Doll kids toys

Barbie Goes School Supply Shopping DIY Miniature Supplies Supermarket diy desk pencil crafts dollhouse Toy …

Easy Santa Paper Puppet DIY – Free Paper Puppet Template Paper Santa Decor

BONUS VIDEO Santa Puppet DIY – get your free Paper Puppet Template and make this …

[wood 경첩 만들기][wood Hinges][사개짜임] diy/목공/공방 wood ro leehyun 목공기계 wood make

* 우드로이현 Wood-ro Leehyun * 이현멀티우드머신 Leehyun multiwoodmachine 연구개발 * HOMEPAGE http://우드로이현.com http://woodroleehyun.com * YOUTUBE …

Handmade Diwali Greeting Card,DIY Diwali Card,Diwali Diya Cards Making Ideas,Cards for Diwali 2018

Handmade Diwali Greeting Card,DIY Diwali Card,Diwali Diya Cards Making Ideas,Cards for Diwali 2018.Happy Diwali 2018,How …

Easy Pumpkin Candle, DIY mini concrete pumpkins for FALL DECOR!

These DIY mini concrete pumpkins aren’t just cute pumpkins but also serve as candle holders. …

8 DIY photo filters you can make at home

COOPH teaches you how to spice up your images with 8 simple, DIY photo filters …

DIY 3D PAPER SQUISHY | How to make a squishy without foam #22

okay okay so i’ve had so many requests recently to do another 3d paper squishy… …

HOW TO MAKE DIY LAVA LAMP SLIME BOTTLES?! (AWESOME ROOM DECOR)

Here’s my more in-depth avalanche slime tutorial: Here’s my soap cutting FAIL video: – Hey …

HOW TO MAKE CASHEW COFFEE CREAMER AT HOME/ RECIPE DIY

Cashew creamer! Have you ever made homemade creamer for your coffee? Yesterday was national coffee …

%d bloggers like this: