Difference between revisions of "VMusic2 Anleitung"

From Digipool-Wiki
Jump to: navigation, search
Line 1: Line 1:
<source lang="c">
+
<pre>
  
 
// vMusic-PlayOnSong by www.olafval.de  
 
// vMusic-PlayOnSong by www.olafval.de  
Line 41: Line 41:
 
}
 
}
  
</source>
+
</pre>

Revision as of 12:11, 25 February 2021


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

#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
#define VMUSIC_RX 14 // yellow cable ti Analog in 0
#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);
}