Week12
Arduino連Processing
-----
程式碼:
#define Do 523
#define Re 587
#define Mi 659
void setup(){
Serial.begin(9600);
pinMode(2,INPUT_PULLUP);
pinMode(8,OUTPUT);
tone(8,Do);
delay(100);
tone(8,Re);
delay(100),
tone(8,Mi);
delay(100);
noTone(8);
}
void loop(){
while(Serial.available()>0)
{
Serial.read();
tone(8,Mi,100);
}
}
-----
程式碼都輸入完
就可以用鍵盤配合MakerUno彈了

沒有留言:
張貼留言