Advertisement
MUstar

IoT 아두이노 0519 - Buzz

May 19th, 2017
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.26 KB | None | 0 0
  1. int pin_PIEZO = 7;
  2. int scale_data[8] = {130,146,164,174,195,220,246,261};
  3.  
  4. void setup(){
  5. pinMode(pin_PIEZO, OUTPUT);
  6. }
  7.  
  8. void loop(){
  9.   for(int i=0;i<8;i++)
  10.   {
  11.     tone(pin_PIEZO, scale_data[i]);
  12.     delay(1000);
  13.   }
  14.   noTone(pin_PIEZO);
  15.   delay(1000);
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement