Go Down

Topic: Arduino Lightsaber (Read 2 times) previous topic - next topic

alangarcia

Nice!  The Force is strong with this one  8)

wildjack6

Just curious what you used for clash and swing sensor

JakeSoft

Swing Sensor:
http://www.thecustomsabershop.com/Swing-Sensor-SW-200D-P486.aspx

Clash Sensor:
http://www.thecustomsabershop.com/Clash-Sensor-SW-18020P-P485.aspx

purgedsoul

So this module can actually do gapless play back? Excellent!

privateRob

Awesome¬≤  8)

What speakers did you use? (8ohm 0.5watt?)
How many db did you get? (It seems as loud as a smartphone on full volume)
On your schematic you didn't use any amplifier, right?

Since you nearly answered all component related questions, you should add the whole list to the first post if possible!

JakeSoft


So this module can actually do gapless play back? Excellent!


Yes! Two ways to do it, even:

1. There is a "repeat" serial command that you can send. It will repeat whatever sound is played with no gaps. As long as there are no dead spots at the start or end of your sound files then it works great.

2. You can program the WT588d to play a list of up to something like 200 sounds when commanded. Sounds are played back-to-back with no gaps.


wildjack6

Would you be willing to share some of your code for the soundboard I started playing with it but can't figure out how to get it to repeat any suggestions would help

JakeSoft

#22
Oct 09, 2014, 03:29 am Last Edit: Oct 09, 2014, 03:32 am by JakeSoft Reason: 1

Would you be willing to share some of your code for the soundboard I started playing with it but can't figure out how to get it to repeat any suggestions would help


Sure. Here is the most important part of the code from SugarBombs:
(See full code here: http://forum.arduino.cc/index.php?topic=227435.0)

Code: [Select]

void WT588D_Send_Command(unsigned char addr) {

 unsigned char i;

 digitalWrite(WT588D_CS, LOW);

 delay(5); //delay per device specifications

 for( i = 0; i < 8; i++)  {    
   digitalWrite(WT588D_SCL, LOW);    
   if(bitRead(addr, i))digitalWrite(WT588D_SDA, HIGH);
   else digitalWrite(WT588D_SDA, LOW);          
   delay(2);  //delay per device specifications  
   digitalWrite(WT588D_SCL, HIGH);    
   delay(2);  //delay per device specifications
 } //end for

 digitalWrite(WT588D_CS, HIGH);

} //end WT588D_Send_Command


Try putting this somewhere in your code:

Code: [Select]


//Turn on repeat mode
WT588D_Send_Command(0xF2);

//Begin playlist 0
WT588D_Send_Command(0x00);



Of course, make sure the WT588d is configured for 3 line serial mode.

JakeSoft

#23
Oct 09, 2014, 03:40 am Last Edit: Oct 10, 2014, 11:38 pm by JakeSoft Reason: 1

Awesome¬≤  8)

What speakers did you use? (8ohm 0.5watt?)
How many db did you get? (It seems as loud as a smartphone on full volume)
On your schematic you didn't use any amplifier, right?

Since you nearly answered all component related questions, you should add the whole list to the first post if possible!


Thanks!

Right, no amplifier needed (although you could certainly add one if you wanted it louder and could find room for it). I don't have any equipment that would allow me to measure it in db, but it's loud enough for me. Smartphone on full volume is probably a pretty good comparison.

I used this speaker in the finished product (8 ohm, 2W):
http://www.thecustomsabershop.com/2W-28mm-Bass-Speaker-P662.aspx

During my breadboarding, I used a very cheap 8 ohm 0.5W speaker that I harvested from a toy. It worked fine, but the sound quality was pretty terrible. Really you should be able to use any 8 ohm speaker with at least a 0.5W power rating. It all depends on your budget and what kind of sound you're looking for. I'll leave that discussion to the audiophiles.

wildjack6

Thanks for the help I will try it out and see what I can get working totally new to programming so any help is appreciated

JakeSoft


Thanks for the help I will try it out and see what I can get working totally new to programming so any help is appreciated


Glad I could help. Just be sure call the WT588D_Send_Command() function from somewhere outside your main loop, like when a button is pressed or something, otherwise you may get odd behavior.

wildjack6

Playing with it hopefully can figure it out lol

privateRob

Thank you!
You Sir earned your first karma for all the questions you answered in this thread!

JakeSoft


Thank you!
You Sir earned your first karma for all the questions you answered in this thread!


Yay!  8)

Go Up