2020年11月30日 星期一

Yang_Week11

 

Aurduino+maker-uno

marker-uno:
























音頻對照表:








歌曲創作:
  • #define C 523///定義音符頻率
  • #define D 587
  • #define E 659
  • #define F 698
  • #define G 784
  • #define A 880
  • int music[]={C,B,F,D,E,A,B,B,C,,G,A,B,,F,D,E,D,E,A};///0是不播音
  • void setup() {
  •   // put your setup code here, to run once:
  •   delay(1000);
  •   pinMode(8,OUTPUT);
  •   for(int i=0;i<sizeof(music)/sizeof(int);i++){
  •     tone(8,music[i],100);///播放(Pin8是蜂鳴器)
  •     delay(250);///音之間的間隔
  •   }
  • }
  • void loop() {}

參考網頁:https://github.com/CytronTechnologies/MakerUno_Examples




沒有留言:

張貼留言