Hi chaps,
So I'm using an Arduino nano to push serial commands to the robertsonics MP3 Trigger. With my very limited knowledge of coding and a lot of reading I've got it doing what I want. Almost. I can make it play specific tracks, and set the volume to whatever I want but I don't understand how to make it fade the sound in when the track is triggered, and fade-out when it's deactivated.
So this is the small piece of code i'm using to test the one track:
void setup() {
Serial.begin(38400);
}
void loop() {
Serial.write('v');
Serial.write(100);
Serial.write('t');
Serial.write(1);
delay(1500);
}
Apparently you can get nice smooth sound transitions, becuase you can write to the board quite quickly.. I just don't know how to. I guess I basically need to make it push decreasing numbers to the serial port (0 is the loudest volume setting, 240 is mute) and rising numbers when the switch is deactivated...
I did try this (as a test) but with some very odd results:
void setup() {
Serial.begin(38400);
}
void loop() {
Serial.write('t');
Serial.write(1);
delay(1500);
Serial.write('v');
Serial.write(100);
Serial.write('v');
Serial.write(90);
Serial.write('v');
Serial.write(80);
Serial.write('v');
Serial.write(70);
Serial.write('v');
Serial.write(60);
Serial.write('v');
Serial.write(50);
Serial.write('v');
Serial.write(40);
Serial.write('v');
Serial.write(30);
Serial.write('v');
Serial.write(20);
Serial.write('v');
Serial.write(10);
}
anyone help a noob out? ![]()