Advertisement
goncharn20

Untitled

Jun 24th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. #include <toneAC.h>
  2. #include "pitches.h"
  3. int noteCount=5;
  4. int notes []= {NOTE_C4, NOTE_GS4, NOTE_B3};
  5. int duration[]= {50, 75, 65};
  6. const int speakerPin=9;
  7.  
  8.  
  9. void setup() {
  10. // put your setup code here, to run once:
  11.  
  12. Serial.begin (9600);
  13.  
  14. }
  15.  
  16.  
  17.  
  18. void loop() {
  19. // put your main code here, to run repeatedly:
  20. for (int i=0; i< noteCount; i++)
  21. {
  22. tone(speakerPin,notes[i], duration [i]);
  23. }
  24. while (1);
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement