Étape 2: Jouer des sons directement depuis l’arduino
buttonState int = 0 ;
const int buttonPin = 2 ;
void setup()
{
Serial.Begin(9600) ;
pinMode (buttonPin, entrée) ;
ProgduinoRunOnce() ;
}
void loop()
{
buttonState = digitalRead(buttonPin) ;
if(ButtonState == High) {}
Serial.println (F (» RunFunction ; MediaPlayer.Play:SND.wav;")) ;
Delay(1000) ;
}
}
void ProgduinoRunOnce() {}
Serial.println (F (« WindowSize ; Largeur : 800 ; hauteur : 600 titre : Music Player;")) ;
}
Vous pouvez ajouter vos fichiers audio vers le dossier sonore à l’intérieur du dossier de Progduino (remplacer le nom de fichier « snd.wav » au nom du fichier).