MUstar

IoT 아두이노 0519 - Buzz_AirFly

May 19th, 2017
64
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. int pin_PIEZO = 7;
  2. int scale_data[26] = {164,146,130,146,164,164,164,146,146,146,164,195,195,164,146,130,146,164,164,164,146,146,164,146,130};
  3.  
  4. void setup(){
  5. pinMode(pin_PIEZO, OUTPUT);
  6. }
  7.  
  8. void loop(){
  9.   for(int i=0;i<26;i++)
  10.   {
  11.     tone(pin_PIEZO, scale_data[i]);
  12.     delay(500);
  13.     noTone(pin_PIEZO);
  14.     delay(100);
  15.   }
  16.   noTone(pin_PIEZO);
  17.   delay(1000);
  18. }
RAW Paste Data