2019年1月10日 星期四

Week11_05160664

Week11
1.
使Maker Uno的燈依序亮起,程式碼:
void setup() {
  // put your setup code here, to run once:
      for(int i=2;i<=13;i++){
          pinMode(i,OUTPUT);
      }
}

void loop() {
  // put your main code here, to run repeatedly:
      for(int i=2;i<=13;i++){
        digitalWrite(i,HIGH);
        delay(300);//not recommend delay in for loop
      }
      for(int i=2;i<=13;i++){
        digitalWrite(i,LOW);
      }
}
2.
播放音樂:到下列的網址
https://makeruno.com.my/changing-melody-with-push-button-using-only-maker-uno/?fbclid=IwAR1inzhRhtNH-teALIYbmbU4lsdJFrV2b1L7VDlRYIcnKw-RzBdaj3jzkmo
複製裡面的程式碼,讓Maker Uno的板播放音樂
3.
換播放聖誕節的音樂:到下列網址
https://makeruno.com.my/changing-melody-with-push-button-using-only-maker-uno/?fbclid=IwAR1inzhRhtNH-teALIYbmbU4lsdJFrV2b1L7VDlRYIcnKw-RzBdaj3jzkmo
注意:在音樂快撥放完前,持續按Button才能切換音樂
4.
如何卡歌(程式碼):if( digitalRead(button) == LOW) break;

沒有留言:

張貼留言