Go Down

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

splinter182

#765
Mar 25, 2016, 04:04 pm Last Edit: Mar 25, 2016, 04:10 pm by splinter182
I'll just leave this right here.

https://youtu.be/2gKd2tWIF-E

I took a look at the manual and the serial commands look pretty robust (after painfully running the command table through Google to translate from Chinese to English, of course).

Dude even made a library with basic functionality which could be expanded upon:
https://github.com/Critters/MP3FLASH16P

I attached my translated serial commands. Not to get us too far off track, but I may pick one of these up for experimenting. It could be one more sound module to add to the USaber library. (I'm working on adding sound support, I swear!)


This looks like the same module that Protonerd is using on his project with flash memory instead of the microsd card slot. I've been working on adding wt588d support to LSOS for my own saber and while going thru  neskweek code it looked like DFPlayer library already has code in place to handle using a MP3-Flash-16p module. It takes a parameter for memory type and flash is one of the options.

Also jake, I'm sorry i never got back to you on hangout. (i asked you as question about wt588d) I made a stupid mistake, i didn't realize i had to set up my playlists.

JakeSoft

This looks like the same module that Protonerd is using on his project with flash memory instead of the microsd card slot. I've been working on adding wt588d support to LSOS for my own saber and while going thru  neskweek code it looked like DFPlayer library already has code in place to handle using a MP3-Flash-16p module. It takes a parameter for memory type and flash is one of the options.
Hey, you might be right! Great observation! After your post, I dissected neskweek's DFPlayer code that he includes with LightSaberOS. The commands look to be identical. That's great news. It means somebody has already laid a lot of the ground work.

I'd actually prefer USB over SD. One could route a small extension cable to an external port on their hilt and then program new sounds without ever taking the hilt apart! Try that with an SD card.

splinter182

#767
Mar 25, 2016, 05:27 pm Last Edit: Mar 25, 2016, 05:33 pm by splinter182
Hey guys !

is that what you call a recharge port/kill switch (5.5mmx2.1mm DC Power jack socket female) ? :

Yes those are exactly it!

follow this link for the wiring:
http://forums.thecustomsabershop.com/showthread.php?2235-Recharge-port-hookup

splinter182

Hey, you might be right! Great observation! After your post, I dissected neskweek's DFPlayer code that he includes with LightSaberOS. The commands look to be identical. That's great news. It means somebody has already laid a lot of the ground work.

I'd actually prefer USB over SD. One could route a small extension cable to an external port on their hilt and then program new sounds without ever taking the hilt apart! Try that with an SD card.
That is true, and with limited space its hard to make things easily removable!

I've found the site of the ebay vendor of the MP3-Flash-16p module, cheaper than ebay and free shipping.

http://www.uctronics.com/64m-bit-mp3-voice-module-serial-spi-flash-ssop24-amplifier-mini-usb-for-arduino.html

neskweek

Yes those are exactly it!

follow this link for the wiring:
http://forums.thecustomsabershop.com/showthread.php?2235-Recharge-port-hookup

Thanks guys. I wanted to be sure before ordering them.
I'd like to order those via TCSS but I leave in europe and 50€ of transport is just not acceptable for me.

I found another source for those , if some of you are interested and if you're not in a hurry (15days delivery min), I'll give you the link via PM.

Finally thank you for the wirings instruction ;)

JakeSoft

That is true, and with limited space its hard to make things easily removable!

I've found the site of the ebay vendor of the MP3-Flash-16p module, cheaper than ebay and free shipping.

http://www.uctronics.com/64m-bit-mp3-voice-module-serial-spi-flash-ssop24-amplifier-mini-usb-for-arduino.html
Thanks for the link. This guy seems to have all kinds of goodies for sale. :)

I wonder how much flash memory the module actually has. The product description says it can support between 2M and 16M but it doesn't actually say how much is on the one being sold. 2M might be just enough for one font at a low quality sample rate, but 16M would give you breathing room for perhaps 2 or more at a high sample rate. The later being preferable, of course.

splinter182

Thanks for the link. This guy seems to have all kinds of goodies for sale. :)

I wonder how much flash memory the module actually has. The product description says it can support between 2M and 16M but it doesn't actually say how much is on the one being sold. 2M might be just enough for one font at a low quality sample rate, but 16M would give you breathing room for perhaps 2 or more at a high sample rate. The later being preferable, of course.
Yes, he has tons of cool stuff. Seems like the sound chip is being used on various different boards and is able to even use a usb flash drive as storage.

The module in the link is for the 64mbit module, so 8 MB of space.
i don't see a 16MB module but shouldn't be too hard to find a 16mb spi flash chip and swap it.
They event suggest a 16MB chip, the W25Q128.

JakeSoft

Yes, he has tons of cool stuff. Seems like the sound chip is being used on various different boards and is able to even use a usb flash drive as storage.

The module in the link is for the 64mbit module, so 8 MB of space.
i don't see a 16MB module but shouldn't be too hard to find a 16mb spi flash chip and swap it.
They event suggest a 16MB chip, the W25Q128.
Well, 8M is workable at least. I've used a WT588Ds with only 8M and was able to fit 2 fonts and some low-sample-rate menu sounds too. With easy sound upload via USB, switching to new sounds frequently is easy anyway.

Canobi

Hey guys

It's time for me to get acquainted properly with the WT programming as the boards are pretty much finished. Filming the last phase is turning out not to be as straightforward as the last two parts were and I've had to cheat and done a couple steps twice which has slowed things down a tad, sorey bout that.

However, I have improved the solder resist process in doing so and the results are much more consistent and are much better quality than I was getting before so it's not all bad.

 
Anyhoo, I've had an idea for a blaster fx core using the WT in key mode and was pondering on making use of the BUSY pin but I can't for the love of me find any info regarding the pin's voltage and current ratings.

Anyone know what they are?

Protonerd

Well, 8M is workable at least. I've used a WT588Ds with only 8M and was able to fit 2 fonts and some low-sample-rate menu sounds too. With easy sound upload via USB, switching to new sounds frequently is easy anyway.
I was intrigued so I just looked at how much storage space all 8 of my high-quality saber fonts (all from SaberFont, no advertisement intended, and I was quite affronted by one of the "artists" covertly accusing me of piracy in a comment to one of my YouTube videos, but you can find really good ones there) take, it's 23MB. They are really good fonts, and after some years building saber replicas in my opinion 4-5 fonts are more than enough. You will settle very fast for some favorites...

JakeSoft

Ok, guys. Here is another drop of the Universal Saber library. The major addition is: Sound! I finally added sound support. And let me tell you, this one didn't come easy. I added an example of how to implement a sound-handling class by creating a saber sound player for the WT588D. I'm still working on multi-font support, but the interface will at least support one sound font plus menu sounds. This is likely enough for simple projects.

1. Added sound support!
WT588DSoundPlayer: A sabers sound player for the WT588D.

You have to parameterize it to tell it how many sound of each type (swing, clash, power-up, etc) you have by populating a data structure. This is an alternative to a bunch of #define or const int statements that have typically been used. It puts it all in one convenient place. These are all things you would have to define anyway, the constructor just forces you to do it up front.

So for example, if you had in your WT588D equations (play lists) programmed like this:
0x00 = Power Up
0x01 = Hum
0x02 = Swing
0x03 = Clash 1
0x04 = Clash 2
0x05 = Power Down

You'd parameterize as in the following example sketch:
Code: [Select]

#include<USaber.h>

//The data structure that describes your sound layout
WT588DSoundMap gSoundMap;

//Pointer to the actual sound player
ASoundPlayer* gpSaberSound;

//The I/O pin for one-line serial comms
#define WT588D_SDA 13

void setup()
{
  //Sound font features
  gSoundMap.Features.PowerUpSoundsPerFont = 1;
  gSoundMap.Features.HumSoundsPerFont = 1;
  gSoundMap.Features.SwingSoundsPerFont = 1;
  gSoundMap.Features.ClashSoundsPerFont = 2; //0x03 and 0x04 are clash sounds
  gSoundMap.Features.PowerDownSoundsPerFont = 1;

  //Base address offset for all sounds (typically zero)
  gSoundMap.Locations.BaseAddr = 0;

  //Sound locations on the module
  gSoundMap.Locations.PowerupBase = 0;
  gSoundMap.Locations.HumBase = 1; 
  gSoundMap.Locations.SwingBase = 2;
  gSoundMap.Locations.ClashBase = 3; //0x03 and 0x04 are clash sounds
  gSoundMap.Locations.PowerdownBase = 5;
 

  //Now create the player
  gpSaberSound = new WT588DSoundPlayer(WT588D_SDA, &gSoundMap);

  //And intialize it
  gpSaberSound->Init();
}

void loop()
{
  //code code code...

  //Get to a place where you want play a power up sound and...
  gpSaberSound->PlaySound(eePowerUpSnd, 0); //Play the 0th (the first) power-up sound

  //blah blah blah...

  //Get to a place where you want to play a random clash sound...
  gpSaberSound->PlayRandomSound(eeClashSnd);
}


2. Fixed a bug in SimpleMotionManager that would sometimes allow double-trigger on clash events.

Whew, I need a break. I hope you all enjoy. MTFBWY.

JakeSoft

#776
Mar 26, 2016, 11:02 pm Last Edit: Mar 26, 2016, 11:08 pm by JakeSoft
I was intrigued so I just looked at how much storage space all 8 of my high-quality saber fonts (all from SaberFont, no advertisement intended, and I was quite affronted by one of the "artists" covertly accusing me of piracy in a comment to one of my YouTube videos, but you can find really good ones there) take, it's 23MB. They are really good fonts, and after some years building saber replicas in my opinion 4-5 fonts are more than enough. You will settle very fast for some favorites...
You may be able to plop down a 16MB flash chip in place of your SD card on a future revision of DIYino. You'll get that USB-sound transfer feature you were looking for a while back in a conversation I remember. I could see two USB ports: One for the MCU, one for the sound. Might take up less room than the SD card too.

And you are right about settling on favorites. I've reprogrammed my Mk. II with several fonts since I built it, but I keep going back to my original set. It supports 3 fonts, but only use my favorite one of them 90% of the time.

Stemplar

Ok, guys. Here is another drop of the Universal Saber library. The major addition is: Sound! I finally added sound support. And let me tell you, this one didn't come easy. I added an example of how to implement a sound-handling class by creating a saber sound player for the WT588D. I'm still working on multi-font support, but the interface will at least support one sound font plus menu sounds. This is likely enough for simple projects.

1. Added sound support!
WT588DSoundPlayer: A sabers sound player for the WT588D.

You have to parameterize it to tell it how many sound of each type (swing, clash, power-up, etc) you have by populating a data structure. This is an alternative to a bunch of #define or const int statements that have typically been used. It puts it all in one convenient place. These are all things you would have to define anyway, the constructor just forces you to do it up front.

So for example, if you had in your WT588D equations (play lists) programmed like this:
0x00 = Power Up
0x01 = Hum
0x02 = Swing
0x03 = Clash 1
0x04 = Clash 2
0x05 = Power Down

You'd parameterize as in the following example sketch:
Code: [Select]

#include<USaber.h>

//The data structure that describes your sound layout
WT588DSoundMap gSoundMap;

//Pointer to the actual sound player
ASoundPlayer* gpSaberSound;

//The I/O pin for one-line serial comms
#define WT588D_SDA 13

void setup()
{
  //Sound font features
  gSoundMap.Features.PowerUpSoundsPerFont = 1;
  gSoundMap.Features.HumSoundsPerFont = 1;
  gSoundMap.Features.SwingSoundsPerFont = 1;
  gSoundMap.Features.ClashSoundsPerFont = 2; //0x03 and 0x04 are clash sounds
  gSoundMap.Features.PowerDownSoundsPerFont = 1;

  //Base address offset for all sounds (typically zero)
  gSoundMap.Locations.BaseAddr = 0;

  //Sound locations on the module
  gSoundMap.Locations.PowerupBase = 0;
  gSoundMap.Locations.HumBase = 1; 
  gSoundMap.Locations.SwingBase = 2;
  gSoundMap.Locations.ClashBase = 3; //0x03 and 0x04 are clash sounds
  gSoundMap.Locations.PowerdownBase = 5;
 

  //Now create the player
  gpSaberSound = new WT588DSoundPlayer(WT588D_SDA, &gSoundMap);

  //And intialize it
  gpSaberSound->Init();
}

void loop()
{
  //code code code...

  //Get to a place where you want play a power up sound and...
  gpSaberSound->PlaySound(eePowerUpSnd, 0); //Play the 0th (the first) power-up sound

  //blah blah blah...

  //Get to a place where you want to play a random clash sound...
  gpSaberSound->PlayRandomSound(eeClashSnd);
}


2. Fixed a bug in SimpleMotionManager that would sometimes allow double-trigger on clash events.

Whew, I need a break. I hope you all enjoy. MTFBWY.
EXCELENT JAKESOFT ...... !!!!!!

In the future, I will try this library.

Stemplar

#778
Mar 28, 2016, 05:03 pm Last Edit: Mar 28, 2016, 05:11 pm by Stemplar
In the past weekend, I have advanced in my project.

I found a library, a talking clock that left me run sounds WT588D-U.

I share a video of the tests.

Prueba de Sable - Massabers


Now we must work on the look and feel of the saber.

Thanks to all for the help.




Protonerd

You may be able to plop down a 16MB flash chip in place of your SD card on a future revision of DIYino. You'll get that USB-sound transfer feature you were looking for a while back in a conversation I remember. I could see two USB ports: One for the MCU, one for the sound. Might take up less room than the SD card too.
You remember right, once I reach break-even with my DIYino design, I want to embark on a quest for a high-end Arduino saber core. I already sketched up in my mind the core requirements:
1. Flash instead of SD
2. Equally important in my eyes is that it must have only a single USB port. An USB takes up nearly the same room as an SD, and latter is flatter.
3. I think about an Atmega with more memory.
4. Use flash to store arbitrary data accessible by the uC.

However this one I intend to do in a team.

Go Up