Registration Notice

Due to increased spam, forum registration must be manually approved by a moderator! Please see this post for instructions.

*

Offline Rileyelf

  • 11
    • View Profile
  • Brighton, UK
Setting output triggers after events
« on: July 14, 2017, 03:19:51 AM »
Hi,
My board is currently in the post on its way to me...   But I thought I'd ask this question early!  8)

Is it possible to set an output to toggle low when the tank fires, gets hit or is destroyed?

That way one could use the simple MSM1 from ELV Elektronik for simple battle sounds.  https://translate.google.com/translate?sl=auto&tl=en&js=y&prev=_t&hl=en&ie=UTF-8&u=https%3A%2F%2Fwww.elv.de%2Fmini-usb-sound-modul-msm1-komplettbausatz.html&edit-text=&act=url

Thanks,
Drew.

*

Offline LukeZ

  • 1241
    • View Profile
  • France
Re: Setting output triggers after events
« Reply #1 on: July 15, 2017, 02:48:59 PM »
I've made a few updates and yes this is possible. There are two new triggers called "Cannon Hit" and "Vehicle Destroyed," you can assign these to any function. We don't need a trigger for cannon fire because cannon fire is itself already a function, if we want to fire the cannon we must assign some trigger to it (ie, a switch). If you want to also set an output low when the cannon is fired, just assign that same switch to the output low function (a single trigger can be assigned to multiple functions, and vice-versa).

To set an output low we can use the general purpose I/O ports A and B. On the Lights & I/O tab of OP Config, set the port directions to "Output" and then the type to "Default High." In other words, these pins will be outputs we can control, and their default state will be high (+5V).

Now go to the function tab and assign your trigger to the "External Output A (or B) - Pulse" function. Pulse will cause the pin to briefly be held to the opposite position of its default state. Since you set the default to high, it will be briefly pulsed to ground.

Ok, that takes care of two outputs, but you'd like to have 3. We can also accomplish the same thing with the Aux light output using the Flash function. Unfortunately the Flash function by definition starts with the pin held low which is then temporarily brought high to "flash." So I've added a new function called "Aux Output - Inverse Flash" that does the opposite.

This might all sound confusing but if you play around with OP Config for a while it will make more sense. If you decide to try interfacing the device you listed please post here and I'll help you out.

By the way, this same general approach should work with similar WAV/MP3 players that operate on the same principle (button press).
NO SUPPORT THROUGH PM - Read why
Need a forum account? Read here
Open Panzer FAQs

*

Offline Rileyelf

  • 11
    • View Profile
  • Brighton, UK
Re: Setting output triggers after events
« Reply #2 on: July 15, 2017, 03:58:59 PM »
That's great, Thanks for your work!   I'll have play with the software.  Sadly the post office mis-delivered my package so I'm still waiting!

Kindest regards,
Drew.


*

Offline Rileyelf

  • 11
    • View Profile
  • Brighton, UK
Re: Setting output triggers after events
« Reply #3 on: December 31, 2017, 11:35:51 AM »
Hiya,

I know it's 6 months down the line but life always seems to get in the way!  I have just put this thing together after swapping the transistors.   

The cannon fire using Aux Light output works fine once I gave it a small load,  I assume the internal pull down resistor did not give it enough load to get the output low enough.

The Cannon Hit function similarly works well but the destroyed does not seem to trigger.  I have put the output on a scope, the output does not change when the tank is destroyed.   I have swapped the ports over, the problem stays with the Vehicle Destroyed Trigger.  The vehicle is showing as destroyed when it is...

On another matter... The Hit light seems to stay on all the time.  Bad transistor or my soldering?

Thanks very much for your help.

Drew




*

Offline LukeZ

  • 1241
    • View Profile
  • France
Re: Setting output triggers after events
« Reply #4 on: December 31, 2017, 03:31:33 PM »
Hi Drew, there was indeed a bug with the vehicle destroyed trigger, typically all triggers are disabled when the vehicle is destroyed, but obviously we want this one still to execute! Shows you how thorough my testing was, I tested the cannon fire trigger but hadn't wanted to get out multiple tanks and fire at myself, so I called it good. Thanks for uncovering the problem.

Anyway - bug fixed, you'll need to flash the latest TCB firmware that I just posted (0.92.16).

As for the hit lights I am guessing it has to do with the MOSFET or your soldering, yes. Always on is the behavior we saw with the wrong MOSFETs Hobby King originally used, this one would be Q7. As you replaced it manually I would check it again, maybe there is a short or maybe it's just faulty. You can also check the input signal to this MOSFET, and make sure that pin on the processor isn't shorted either, I've highlighted it in red below.
tcbtop.png
Setting output triggers after events tcbtop.png
Views: 1240
NO SUPPORT THROUGH PM - Read why
Need a forum account? Read here
Open Panzer FAQs

*

Offline Rileyelf

  • 11
    • View Profile
  • Brighton, UK
Re: Setting output triggers after events
« Reply #5 on: January 01, 2018, 07:39:01 AM »
Awesome, thanks.  All working fine now!     

I can confirm with a small load on the Aux Output the board performs perfectly with the Elv Elektronik MSM1 sound player https://www.elv.at/mini-usb-sound-modul-msm1-komplettbausatz.html card which is commonly used with David's Battle Circuit to give battle sounds.  It also works with my own design sound card...  https://www.youtube.com/watch?v=GwCtG5Lvi3Y

My problem with the Hit light must have been caused when I swapped the Mosfet.  There was no connection between the gate of Q7 and R3.  A tiny jumper wire and it worked perfectly.

Thanks so much for all your hard work, it's very much appreciated.

Drew.

*

Offline LukeZ

  • 1241
    • View Profile
  • France
Re: Setting output triggers after events
« Reply #6 on: January 01, 2018, 06:05:55 PM »
Great! Glad to hear everything is sorted, and thanks for the information on the ELV sound card, I hope that proves useful to someone else. As I've said many times now I'm always surprised at all of the out-of-the-box ideas and alternatives users like yourself have come up with.

NO SUPPORT THROUGH PM - Read why
Need a forum account? Read here
Open Panzer FAQs

*

Offline Rileyelf

  • 11
    • View Profile
  • Brighton, UK
Re: Setting output triggers after events
« Reply #7 on: January 06, 2018, 05:54:28 PM »
Here's a quick video of the thing...


Drew.

*

Offline LukeZ

  • 1241
    • View Profile
  • France
Re: Setting output triggers after events
« Reply #8 on: January 06, 2018, 07:09:27 PM »
I enjoyed it! I don't mind seagulls. ;)

What really piqued my curiosity was the brief glimpse of the car around the 4:00 minute mark. Maybe a Morris?
NO SUPPORT THROUGH PM - Read why
Need a forum account? Read here
Open Panzer FAQs

 

bomber-explosion