User Tools

Site Tools


courses:intro.prototyping.spring.2011.mar10

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
courses:intro.prototyping.spring.2011.mar10 [2011/03/22 01:38]
130.239.148.47
courses:intro.prototyping.spring.2011.mar10 [2011/03/22 01:54] (current)
130.239.148.47
Line 1: Line 1:
 +Part of the course [[courses:​introduction_to_prototyping_spring_2011|Intro to Prototyping IxD1, Spring 2011]]
  
 +=== Vmusic2 ===
 +The Vmusic2 is a standalone MP3-player which you can control using serial commands. The setup is a bit clumpsy, but when it's up you have a lot of possibilities to build interactive stuff with sound. ​
 +
 +Here are the [[workshop:​vmusic2_arduino|basics]] on connecting, serial communication and commands.
 +
 +Since we can use the standard serial port on the arduino to check on status, it's worth getting into how to create an extra serial port for sending commands to the Vmusic2. ​
 +
 +
 +An example of a bare minimum program to play a sound once, with no interaction:​
 +<code java>
 +#include <​SoftwareSerial.h>​
 +
 +//​establishing digital pin 6 and 7 to be the extra serial port
 +#define VMUSIC_RX 6
 +#define VMUSIC_TX 7
 +
 +// 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 pins:
 +  pinMode(VMUSIC_RX,​ INPUT);
 +  pinMode(VMUSIC_TX,​ OUTPUT);
 +
 +
 +  // set the data rate for the SoftwareSerial port
 +  mySerial.begin(9600);​
 +  Serial.println("​Start"​); ​ //Sending statusinfo back through the standard serial port
 +
 +   //​Sending the command to play a sound through the new serial port   
 +   ​mySerial.print("​VPF kettle.mp3"​);​ //​kettle.mp3 is my soundfile, what is your?
 +   ​mySerial.print(0x0D,​BYTE);​
 +}
 +
 +void loop() {
 +  ​
 +}
 +
 +</​code>​
 +
 +Start to connect the Arduino to the Vmusic2 with a memorystick with the sounds of your choice and get it working with the basic example. From there, go on by connecting buttons, sensors, servos and have them work with sounds. The possibilities are endless!
courses/intro.prototyping.spring.2011.mar10.txt · Last modified: 2011/03/22 01:54 by 130.239.148.47