Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. const int SoundPin = 9;
  2. int DelaySound = 500;
  3. void setup() {
  4. }
  5.  
  6. void loop() {
  7. if(digitalRead(2) == LOW){
  8. digitalWrite(7, HIGH);
  9. delay(500)
  10. digitalWrite(7, LOW);
  11. delay(250)
  12. }
  13. if(digitalRead(2) == HIGH){
  14. tone(SoundPin, 262); // ДО
  15. delay(DelaySound);
  16. noTone(9);
  17. delay(DelaySound);
  18. tone(SoundPin, 294); //РЕ
  19. delay(DelaySound);
  20. noTone(9);
  21. delay(DelaySound);
  22. tone(SoundPin, 329);//МИ
  23. delay(DelaySound);
  24. noTone(9);
  25. delay(DelaySound);
  26. tone(SoundPin, 349);//ФА
  27. delay(DelaySound);
  28. noTone(9);
  29. delay(DelaySound);
  30. tone(SoundPin, 392);//СОЛЬ
  31. delay(DelaySound);
  32. noTone(9);
  33. delay(DelaySound);
  34. tone(SoundPin, 440);//ЛЯ
  35. delay(DelaySound);
  36. noTone(9);
  37. delay(DelaySound);
  38. tone(SoundPin, 494);//СИ
  39. delay(DelaySound);
  40. noTone(9);
  41. delay(DelaySound);
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement