Advertisement
Juan_Blanc

Sound Bomb Arduino

Jul 17th, 2015
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.01 KB | None | 0 0
  1. int PinParlante = 6; //Pin de salida
  2. int numTones = 15; // cantidad de veces que se repite el beep
  3. void setup()
  4. {
  5.     for (int i = 0; i < 5; i++)
  6.   {
  7.     tone(PinParlante,8168);
  8.     delay(100);
  9.     noTone(PinParlante);
  10.     delay(1000);
  11.   }
  12.   for (int i = 0; i < 5; i++)
  13.   {
  14.     tone(PinParlante,8168);
  15.     delay(100);
  16.     noTone(PinParlante);
  17.     delay(700);
  18.   }
  19.     for (int i = 0; i < numTones; i++)
  20.   {
  21.     tone(PinParlante,8168);
  22.     delay(100);
  23.     noTone(PinParlante);
  24.     delay(300);
  25.   }
  26.     for (int i = 0; i < numTones; i++)
  27.   {
  28.     tone(PinParlante,8168);
  29.     delay(100);
  30.     noTone(PinParlante);
  31.     delay(150);
  32.   }
  33.     for (int i = 0; i < numTones; i++)
  34.   {
  35.     tone(PinParlante,8168);
  36.     delay(100);
  37.     noTone(PinParlante);
  38.     delay(100);
  39.   }
  40.     for (int i = 0; i < 50; i++)
  41.   {
  42.     tone(PinParlante,8168);
  43.     delay(100);
  44.     noTone(PinParlante);
  45.     delay(50);
  46.   }
  47.   noTone(PinParlante);
  48. }
  49.  void loop()
  50. {
  51.   //no va nada, a no ser que quieras agregar algo más
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement