Rywo

exercise 10

Jun 18th, 2019
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.11 KB | None | 0 0
  1. int speakerPin = 8;
  2.  
  3. void setup() {
  4. pinMode(speakerPin, OUTPUT);
  5. }
  6.  
  7.  
  8. //Take on me
  9. void loop() {
  10. tone(speakerPin, 392, 200); // plays note G of 262Hz for 200ms
  11. delay(250); // wait 250 ms
  12. tone(speakerPin, 392, 200); // plays note G of 262Hz for 200ms
  13. delay(250);
  14. tone(speakerPin, 330, 200); // plays note E of 262Hz for 200ms
  15. delay(250);
  16. tone(speakerPin, 262, 300); // plays note C of 262Hz for 200ms
  17. delay(250);
  18. tone(speakerPin, 262, 300); // plays note C of 262Hz for 200ms
  19. delay(250);
  20. tone(speakerPin, 349, 300); // plays note F of 262Hz for 200ms
  21. delay(250);
  22. tone(speakerPin, 349, 200); // plays note F of 262Hz for 200ms
  23. delay(250);
  24. tone(speakerPin, 349, 200); // plays note F of 262Hz for 200ms
  25. delay(250);
  26. tone(speakerPin, 440, 200); // plays note A of 262Hz for 200ms
  27. delay(250);
  28. tone(speakerPin, 440, 200); // plays note A of 262Hz for 200ms
  29. delay(250);
  30. tone(speakerPin, 493, 200); // plays note B of 262Hz for 200ms
  31. delay(250);
  32. tone(speakerPin, 523, 200); // plays note C of 262Hz for 200ms
  33. delay(250);
  34. tone(speakerPin, 523, 200); // plays note C of 262Hz for 200ms
  35. delay(250);
  36. tone(speakerPin, 523, 200); // plays note C of 262Hz for 200ms
  37. delay(250);
  38. tone(speakerPin, 523, 200); // plays note C of 262Hz for 200ms
  39. delay(250);
  40. tone(speakerPin, 392, 300); // plays note G of 262Hz for 200ms
  41. delay(250);
  42. tone(speakerPin, 349, 300); // plays note F of 262Hz for 200ms
  43. delay(250);
  44.  
  45. tone(speakerPin, 440, 200); // plays note A of 262Hz for 200ms
  46. delay(250);
  47. tone(speakerPin, 440, 200); // plays note A of 262Hz for 200ms
  48. delay(250);
  49. tone(speakerPin, 440, 200); // plays note A of 262Hz for 200ms
  50. delay(250);
  51. tone(speakerPin, 392, 200); // plays note G of 262Hz for 200ms
  52. delay(250);
  53. tone(speakerPin, 392, 200); // plays note G of 262Hz for 200ms
  54. delay(250);
  55. tone(speakerPin, 440, 200); // plays note G of 262Hz for 200ms
  56. delay(250);
  57. tone(speakerPin, 392, 200); // plays note A of 262Hz for 200ms
  58. delay(250);
  59.  
  60. }
Add Comment
Please, Sign In to add comment