Jump to content

arduino: a cheap board for E11 blaster effects


Recommended Posts

Hi Manual, I have a question is it the same din pin on each of the drivers, or is it a different pin for each colour?

I am doing one of these builds and just need to make sure. If they are all the end connector, that is easy,

Link to comment
Share on other sites

Hi Manual, I have a question is it the same din pin on each of the drivers, or is it a different pin for each colour?

I am doing one of these builds and just need to make sure. If they are all the end connector, that is easy,

 

yes, same Dim Pin on each driver

 

20148578_img_9969.jpg

Link to comment
Share on other sites

I am stuck.......the code section I have added as Tie fighter blaster is not working.. Basically I and running with 4 weapons modes. Ell blaster, rapid fire, stun and the Tie, but for some reason the first 3 activate and the green led and sound for tie do not. The code looks good but I must have missed something. Poodoo!

 

 

Sent from my iPad using Tapatalk

Link to comment
Share on other sites

Question - the LED drivers I have bought have PWM marked on them.  Will this work with the code/arduino or have I purchased the wrong thing?  I wired one LED up with a driver straight to a 8.4v lipo, and it worked at max brightness, so I know the drivers are ok if you don't put anything into the pwm inputs.

 

blasterled.jpg
 
leddriver.jpg
 
leddriverpwm.jpg
Edited by Balders
Link to comment
Share on other sites

Got my counter working for shoot and reload, but not sure if change weapon is working.<br><br>

 

 

cool!

keep in mind that if you use my code, when you change weapon it should keep memory of the ammo available for each weapon.

Link to comment
Share on other sites

Ahhhh!  I was expecting the counter to reset when changing weapons!  In which case it's hopefully working correctly.  My mp3 player has still not arrived (everything else has been here for several days) so I really can't progress much, although I will try to get the PWM LED's working maybe tomorrow.

Link to comment
Share on other sites

Hi Manuel Here is the Zip file for the Code I am having trouble with.

Basicaly Weapon 4 TIE blaster sound, will not work and the green LED will not activate.

Perhaps i have the sound files in the wrong order on the SD card, but everything else is working.

e11_v06_en.zip

Link to comment
Share on other sites

Hi Manuel Here is the Zip file for the Code I am having trouble with.

Basicaly Weapon 4 TIE blaster sound, will not work and the green LED will not activate.

Perhaps i have the sound files in the wrong order on the SD card, but everything else is working.

attachicon.gife11_v06_en.zip

 

from your code i see:

 

 

    //-------------------------- WEAPON 1  --- BLASTECH E11 SINGLE FIRE MODE

 

          // play file 002_E11_single.mp3

          Serial.write(0x7E);

          Serial.write(0x04);

          Serial.write(0xA0);

          Serial.write(0x00);

          Serial.write(0x02);

          Serial.write(0x7E);

 

 

//-------------------------- WEAPON 2  --- BLASTECH E11 - Rapid Fire (3 shots per trigger pull)

         // play file 003_E11_multi.mp3

         Serial.write(0x7E);

         Serial.write(0x04);

         Serial.write(0xA0);

         Serial.write(0x00);

         Serial.write(0x03);

         Serial.write(0x7E);

 

//-------------------------- WEAPON 3  --- BLASTECH E11 - STUN

 

      // play file 004_E11_stun.mp3

      Serial.write(0x7E);

      Serial.write(0x04);

      Serial.write(0xA0);

      Serial.write(0x00);

      Serial.write(0x04);

      Serial.write(0x7E);

 

 

 

 //-------------------------- WEAPON 4  --- BLASTECH E11 Tie FIRE MODE

 

          // play file 008_TIE_.mp3

          Serial.write(0x7E);

          Serial.write(0x04);

          Serial.write(0xA0);

          Serial.write(0x00);

          Serial.write(0x02);

          Serial.write(0x7E);

 

 

the blaster sound for weapon 4 is linked to mp3 file name sorted as 2, so it can't be 008_TIE_.mp3

 

remember my instructions on the first message and instructions inside the code:

 

sound tracks numbers need converxion to hexadecimal letters/numbers

you can use the script in this website:   http://www.statman.info/conversions/hexadecimal.html    

 

example:

 

if track number is "10" ---> "A" hexadecimal

 

    // start sound

    Serial.write(0x7E);

    Serial.write(0x04);

    Serial.write(0xA0); // A0 for SD card

    Serial.write(0x00); // track high byte

    Serial.write(0x0A); // track low byte

    Serial.write(0x7E);

 

if track number is "280" ---> "118" hexadecimal

 

    // start sound

    Serial.write(0x7E);

    Serial.write(0x04);

    Serial.write(0xA0); // A0 for SD card

    Serial.write(0x01); // track high byte

    Serial.write(0x18); // track low byte

    Serial.write(0x7E);

 

 

 it's very important the order of the files saved in the microsd... Even if the files are named 001.mp3, 002.mp3 ecc... this sound module will read the files in the order they were added on the card, that means it will not respect the order by  files name (and that means you can't call the mp3 files by name order with arduino code!). That's why you need to sort them after copied, follow the instructions on page 1 of this topics

 

 

as far as for the green led on pin 9, it seems ok, try to test it, turning on  few seconds at startup, maybe it's a soldering problem

Edited by skyone
Link to comment
Share on other sites

from your code i see:

 

 

    //-------------------------- WEAPON 1  --- BLASTECH E11 SINGLE FIRE MODE

 

          // play file 002_E11_single.mp3

          Serial.write(0x7E);

          Serial.write(0x04);

          Serial.write(0xA0);

          Serial.write(0x00);

          Serial.write(0x02);

          Serial.write(0x7E);

 

 

//-------------------------- WEAPON 2  --- BLASTECH E11 - Rapid Fire (3 shots per trigger pull)

         // play file 003_E11_multi.mp3

         Serial.write(0x7E);

         Serial.write(0x04);

         Serial.write(0xA0);

         Serial.write(0x00);

         Serial.write(0x03);

         Serial.write(0x7E);

 

//-------------------------- WEAPON 3  --- BLASTECH E11 - STUN

 

      // play file 004_E11_stun.mp3

      Serial.write(0x7E);

      Serial.write(0x04);

      Serial.write(0xA0);

      Serial.write(0x00);

      Serial.write(0x04);

      Serial.write(0x7E);

 

 

 

 //-------------------------- WEAPON 4  --- BLASTECH E11 Tie FIRE MODE

 

          // play file 008_TIE_.mp3

          Serial.write(0x7E);

          Serial.write(0x04);

          Serial.write(0xA0);

          Serial.write(0x00);

          Serial.write(0x02);

          Serial.write(0x7E);

 

 

the blaster sound for weapon 4 is linked to mp3 file name sorted as 2, so it can't be 008_TIE_.mp3

 

remember my instructions on the first message and instructions inside the code:

 

sound tracks numbers need converxion to hexadecimal letters/numbers

you can use the script in this website:   http://www.statman.info/conversions/hexadecimal.html    

 

example:

 

if track number is "10" ---> "A" hexadecimal

 

    // start sound

    Serial.write(0x7E);

    Serial.write(0x04);

    Serial.write(0xA0); // A0 for SD card

    Serial.write(0x00); // track high byte

    Serial.write(0x0A); // track low byte

    Serial.write(0x7E);

 

if track number is "280" ---> "118" hexadecimal

 

    // start sound

    Serial.write(0x7E);

    Serial.write(0x04);

    Serial.write(0xA0); // A0 for SD card

    Serial.write(0x01); // track high byte

    Serial.write(0x18); // track low byte

    Serial.write(0x7E);

 

 

 it's very important the order of the files saved in the microsd... Even if the files are named 001.mp3, 002.mp3 ecc... this sound module will read the files in the order they were added on the card, that means it will not respect the order by  files name (and that means you can't call the mp3 files by name order with arduino code!). That's why you need to sort them after copied, follow the instructions on page 1 of this topics

 

 

as far as for the green led on pin 9, it seems ok, try to test it, turning on  few seconds at startup, maybe it's a soldering problem

 

Ah so simple, Thank you so much, that has fixed it immediatly.

Also checked the connections and sorted the green Led out, well almost, as know it just stays on after the sound has finished, until i either reload the weapon or change weapons.

Link to comment
Share on other sites

Hi Skyone, I need some help please.  I've got everything wired up (apart from MP3 player which I fried, new one on way down). However, my main LED RGB is always on, and gives a small "pulse".

 

I've uploaded a short video to demonstrate.

 

Help me Obi-Wan, you're my only hope...

 

https://youtu.be/yE_YU3G6zs0

Link to comment
Share on other sites

That's the way it's programmed. ;-) you can change the pulse speed in the arduino code.<br>

I think I used a PWM output, not an analog one. The pulse steps are finer and it looks much more pulsing then blinking. <br>

Hope that helps.

Link to comment
Share on other sites

But rather than pulse like that (in "standby") shouldn't the LED be off completely?  I am only just starting to learn arduino, so forgive my lack of knowledge...is this something to do with the pulses being too "quick" for my led driver boards, hence why it's on all the time?  Any help for a newbie very welcome :)  Note in the video, I hadn't pressed any buttons.  The hengstler works as per design, so I think I'm close.

 

Edit: OK, by process of elimination, I've found that Pin D11 is the one that causes the LED to blink as per the video.  It does that if I connect any of the driver-side pwm wires to D11 (regardless of whether the others are plugged into D9 and D10).

 

None the wiser at the moment.

 

Edit 2: Shouldn't this piece of code turn the main LED off altogether, or is it because it's not reading the PWM value? I thought pwn was analogwrite?

      digitalWrite(ledPin, LOW);   // turn off the RGB Led

      digitalWrite(ledPin9, LOW);
      digitalWrite(ledPin10, LOW);
Edited by Balders
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...