#define BZ 3 //ブザーピン #define LED 13 //LEDーピン #define F1min 620 //pu(低音)の最低周波数 #define F1max 660 //pu(低音)の最高周波数 #define F2min 2700 //i(高音)の最低周波数 #define F2max 3200 //i(高音)の最高周波数 #define puTime 150 //pu(低音)の時間(ミリ秒) #define iTime 20 //i(高音)の時間(ミリ秒) boolean BZval; word tempo; void setup(){ pinMode( BZ, OUTPUT); pinMode( LED, OUTPUT); delay(500); randomSeed(analogRead(0)); //乱数補正 } void loop(){ pui(); delay(50); pui(); delay(1000); MoruCarIntro(); delay(1500); pui(); delay(1000); while(1){ delay(random(2000)); pui(); } } void pui(){ float F1=getF(1); float F2=getF(2); BeepF(F1,puTime); Bendto(F1,F2); BeepF(F2,iTime); } void Bendto(float Fcur,float Fend){ while(Fcur