วันเสาร์ที่ 20 ตุลาคม พ.ศ. 2561

Arduino Happy Birthday Song

//Sound frequency note By Yoshioka

float G_LL = 783.991;
float A_L = 880;
float B_L = 987.767;
float C_L = 1046.50;
float D_L = 1174.66;
float E_L = 1318.51;
float F_L = 1396.91;
float G_L = 1567.98;
float A_M = 1760.00;
float B_M = 1975.53;
float C_M = 2093.00;
float D_M = 2349.32;
float E_M = 2637.02;
float F_M = 2793.83;
float G_M = 3135.96;
float A_H = 3520.00;
float B_H = 3951.07;

void happybirthdaysong()
{
  tone(speakerPin, G_LL, 200);
  delay(200);
  tone(speakerPin, G_LL, 200);
  delay(200);
  tone(speakerPin, A_L, 400);
  delay(400);
  tone(speakerPin, G_LL, 400);
  delay(400);
  tone(speakerPin, C_L, 400);
  delay(400);
  tone(speakerPin, B_L, 800);
  delay(1000); 

  tone(speakerPin, G_LL, 200);
  delay(200);
  tone(speakerPin, G_LL, 200);
  delay(200);
  tone(speakerPin, A_L, 400);
  delay(400);
  tone(speakerPin, G_LL, 400);
  delay(400);
  tone(speakerPin, D_L, 400);
  delay(400);
  tone(speakerPin, C_L, 800);
  delay(1000); 

  tone(speakerPin, G_LL, 200);
  delay(200);
  tone(speakerPin, G_LL, 200);
  delay(200);
  tone(speakerPin, G_L, 400);
  delay(400);
  tone(speakerPin, E_L, 400);
  delay(400);
  tone(speakerPin, C_L, 400);
  delay(400);
  tone(speakerPin, B_L, 400);
  delay(400);
  tone(speakerPin, A_L, 800);
  delay(1000);

  tone(speakerPin, F_L, 200);
  delay(200);   
  tone(speakerPin, F_L, 200);
  delay(200);     
  tone(speakerPin, E_L, 400);
  delay(400);     
  tone(speakerPin, C_L, 400);
  delay(400);       
  tone(speakerPin, D_L, 600);
  delay(400);       
  tone(speakerPin, C_L, 900);
  delay(1000);         
  }

ไม่มีความคิดเห็น:

แสดงความคิดเห็น

แก้ Active Desktop Recovery

เข้าไปแก้ Value ในไฟล์ DeskHtmlVersion  ให้กลายเป็น 0 ไม่ให้แสดงหน้าต่าง Active Desktop Recovery เข้าไปที่  HKEY_CURRENT_USER/Software/Mi...