VMusic2 Anleitung

From Digipool-Wiki
Revision as of 15:35, 6 July 2012 by WikiSysop (Talk | contribs)

Jump to: navigation, search

<source lang="c">

// vMusic-PlayOnSong by www.olafval.de // more info: www.vinculum.com/prd_vmusic1.html

  1. include <SoftwareSerial.h>

// USB-stick max 4 G // Name Songs "001.mp3" "002.mp3" . . . // cut the blue // conect the brown to the reen cable // red cable to 5V // black cable to GND

  1. define VMUSIC_RX 14 // yellow cable ti Analog in 0
  2. define VMUSIC_TX 15 // orange cable ti Analog in 1


// set up a new serial port SoftwareSerial mySerial = SoftwareSerial(VMUSIC_RX, VMUSIC_TX);

void setup() {

 Serial.begin(9600);	// opens serial port, sets data rate to 9600 bps
 // define pin modes for tx, rx, led pins:
 pinMode(VMUSIC_RX, INPUT);
 pinMode(VMUSIC_TX, OUTPUT);
   
 // set the data rate for the SoftwareSerial port
 mySerial.begin(9600);
 
 mySerial.print("VSV"); // set volume
 mySerial.print(0,BYTE); // should be between 0 (loud) and 254 (mute)
 mySerial.print(0x0D,BYTE);

}

void loop() {

 Serial.println("Song_1"); 
 mySerial.print("VPF 001.mp3"); // play song nr one
 mySerial.print(0x0D,BYTE);
delay(9000);

}

</source>