SHARE
TWEET

code

a guest Apr 12th, 2014 131 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //connect + wire of speaker to arduino pin 13
  2. // and - to ground
  3. //upload the given code
  4. int speakerPin = 13;
  5. void setup()
  6. {
  7. pinMode(speakerPin,OUTPUT);
  8. }
  9. void loop()
  10. {
  11. tone(speakerPin, 2600); // m
  12. delay(500);
  13. noTone(speakerPin);
  14. delay(250);
  15. tone(speakerPin, 8010); // a
  16. delay(500);
  17. noTone(speakerPin);
  18. delay(250);
  19. tone(speakerPin, 5090); // h
  20. delay(500);
  21. noTone(speakerPin);
  22. delay(250);
  23. tone(speakerPin, 1200); // e
  24. delay(500);
  25. noTone(speakerPin);
  26. delay(250);
  27. tone(speakerPin, 6020); // s
  28. delay(500);
  29. noTone(speakerPin);
  30. delay(250);
  31. tone(speakerPin, 5090); // h
  32. delay(1000);
  33. noTone(speakerPin);
  34. delay(500);
  35. ////////////////////////////////////////
  36. tone(speakerPin, 7030); // i
  37. delay(500);
  38. noTone(speakerPin);
  39. delay(250);
  40. tone(speakerPin, 6020); // s
  41. delay(1000);
  42. noTone(speakerPin);
  43. delay(500);
  44. ////////////////////////////////////////////
  45. tone(speakerPin, 2070); // c
  46. delay(500);
  47. noTone(speakerPin);
  48. delay(250);
  49. tone(speakerPin, 7060); // o
  50. delay(500);
  51. noTone(speakerPin);
  52. delay(250);
  53. tone(speakerPin, 7060); // o
  54. delay(500);
  55. noTone(speakerPin);
  56. delay(250);
  57. tone(speakerPin, 3090); // l
  58. delay(1000);
  59. noTone(speakerPin);
  60. delay(500);
  61. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top