Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* --- SRISAWATWITTAYAKARN MARCH SCHOOL --- */
- /* --- Created by Krittamet Thawong --- */
- /* --- Credit: Teacher Piya Kanatham --- */
- /* --- Published on 2017/08/02 --- */
- #include <ipst.h> // include for IPST-SE Board
- #define time1 350 // Eighth Note
- #define time2 600 // Quarter Note
- #define time3 1200 // Half Note
- #define time4 1600 // Whole Note
- int Round=0; //
- void setup() {
- glcdClear(); // Clear Screen
- setTextSize(11); // 11x Text Size
- setTextColor(GLCD_RED); // Red Text
- glcd(0,0,"S");
- setTextColor(GLCD_YELLOW); // Yellow Text
- glcd(0,1,"W");
- setTextSize(3); // 3x Text Size
- setTextColor(GLCD_ORANGE);// Orange Text
- glcd(3,1,"March");
- }
- void loop() {
- setTextSize(2); // 2x Text Size
- int state=0;
- setTextColor(GLCD_DOLLAR);
- glcd(6,1,"Press");
- glcd(7,2,"to play");
- setTextColor(GLCD_YELLOW);
- while(sw_OK()==0) // unless press OK
- {
- if (state==0)
- {
- glcd(6,7,"OK.");
- }
- else
- {
- glcd(6,7," ");
- }
- delay(150);
- state=state^0x01;
- }
- setTextColor(GLCD_GREEN);
- glcd(6,1," Playing ");
- glcd(7,2," ");
- setTextColor(GLCD_WHITE);
- Round=0;
- for(Round=0;Round<3;Round++) // 3 Rounds of Playing SW March.
- {
- for(int i=0;i<2;i++) //"SRISAWAT" 2 Rounds
- {
- sound(E_5,time1); //SRI
- sound(F_5,time1); //SA
- sound(G_5,time2); //WAT
- delay(100);
- sound(C_5,time1); //SRI
- sound(C_5,time1); //SA
- sound(C_5,time1); //WAT
- delay(250);
- }
- delay(100);
- sound(C_5,time1); //JONG
- sound(D_5,time1); //RENG
- sound(E_5,time1); //RAT
- delay(250);
- sound(E_5,time2); //TANG
- sound(F_5,time2); //JAI
- sound(G_5,time2); //WAI
- sound(D_5,time3); //LAI
- delay(250);
- sound(B_4,time1); //MAI
- sound(C_5,time1); //TONG
- sound(D_5,time1); //KHRAM
- sound(E_5,time1); //KRENG
- sound(D_5,time1); //KHAM
- sound(C_5,time1); //PHU
- sound(B_4,time1); //DAI
- delay(250);
- sound(B_4,time1); //PHA
- sound(C_5,time1); //YA
- sound(D_5,time1); //YAM
- sound(E_5,time1); //BAK
- sound(D_5,time1); //BAN
- sound(C_5,time1); //KHAO
- sound(B_4,time1); //PAI
- delay(250);
- sound(G_5,time1); //REW
- sound(G_5,time1); //KHAO
- sound(G_5,time2); //WAI
- sound(F_5,time2); //NAM
- sound(E_5,time2); //CHAI
- sound(D_5,time2); //MA
- sound(D_5,time2); //HAI
- if(Round==2)
- {
- sound(C_5,time3);//RAO(C)
- }
- else{
- sound(E_5,time3);//RAO(E)
- }
- delay(time1);
- }
- setTextColor(GLCD_SKY);
- glcd(6,0,"Thank you!");
- delay(3000);
- glcd(6,0," ");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement