Kaimana RGB LED Board thread, RGB animations and more! SRK Tech Talk 2013 Product of the Year!

Update. Got it working it turned out to be the main PCB cable. Also noticed one of the J2 LED 3-pin socket was loose.

after only being in there for a few weeks my paradise arcade joystick RGB LED wire has snapped =(
Not sure if I can get anything similar here in the UK =/ PA’s UK shipping costs are pretty steep =/

Hi all,

Apologies if this is in the wrong place, this mainly relates to the wiring rather than programming LEDs etc.

OK, so I have the following TE2+ (stock no mods), a Kaimana Khameleon board, Kaimana mini breakout board and a 20 pin wiring harness (all provided by the amazing folks at Paradise Arcade Shop).

The part I am having an issue with is how to connect the stock PCB on the TE2+ to the mini breakout. At the moment it looks like I need to use the stock button wiring that comes from the TE2+ PCB, cut off the terminals and wire into the mini breakout - this will give me all the 8 buttons - I presume this is correct, there’s no other way of going from the TE2+ stock PCB to the breakout without cutting wires?

What the above doesn’t give me (as far as I can tell) is the power or ground, so where do I take this from on the TE2+ board - soldering some wires from certain points on the board, or cutting into more of the stock wiring?

Finally I then have the joystick wiring from the TE2+ which is 5 wires - again do I cut into the stock wiring and add or is there a better way? Also are the 5 wires, up, down, left, right, ground, or am I completely wrong on this?

I’ve already checked out all of the YouTube videos on this and the FAQs on Paradise Arcade, but there is nothing specific to using the stock TE2 or TE2+ boards, only info on using it with a Brooks PS3/PS4 PCB or Universal Fight Board (which I am not using).

Ideally I’d want some custom harness that comes from the TE2+ to the mini breakout, that would save me cutting wires or soldering, but I am not sure such a thing exists (maybe there should be as I can’t be the only person wanting to do this with a stock TE2 or TE2+).

Many thanks in advance for any ideas or help.

Jamie

Man so sorry about that.

Any rgb led from an electronics shop will do but you would have to build the harness. Just make sure the size of the led is the same or smaller if you don’t find it. Without a slip ring it will keep breaking if the stick is rotated enough. Mine is working OK but that stick doesn’t get a lot of use.

Ok so its not a simple setup but its doable , heres how I see it…

You can choose have to use the 20p harness because of the common ground but you still have to cut and connect from the TE factory harness connector and the joystick connector to the breakout, you can get rid of the wiring that is there already in the stick. Then only connect 1 ground from the TE harness to the Kaimana breakout

You should be left with something like this:
Original:
[buttons]===========[harness conn]=======[PCB]=====[usbplub]
[Joy]===============================^

New:
[20p harness buttons]=====//[breakout]//==(bring only 1 GND here)===[harness conn]====[PCB]========[usbplug]
[20p harness Joy]============^

For power and ground, you have to solder a wire from the USB VCC and GND points in the PCB and insert it into the corresponding terminals in the Breakout. Another solution (only if you REALLY cant solder) is to get aphreakmods usb tool to leech power but you will have to also cut the usb cord and insert the usb tool as a breakout.

This would result in something like this:

[buttons]=====//[breakout]//======[harness conn]====[PCB]====[Phreaks]====[usbplug]
[Joy]============^ ((((((((((((((((((((((((((((( ^===(VCC and GND wire)==^

Let me know if you get this i know its kinda convoluted XD

@JRDIBBS Thank you very much for the detailed info - I think it makes sense!

I’ve ordered a couple of bits and pieces that hopefully means I can save the stock wiring and just use the additional items instead:

16 pin IDC female to female connector, which will replace the stock button wiring and be cut at one end to access the bare wires and put them into the breakout: http://www.ebay.co.uk/itm/272513892745?_trksid=p2057872.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT

Sanwa 5 pin joystick cable with bare ends to go into the breakout: https://www.arcadeworlduk.com/products/Sanwa-JLF-H.html

Then I’ve got some red and black wire to go from the VCC and ground on the TE2+ to the breakout. Is this obvious where these points are? Any images floating around of where to look?

So hopefully with the above additions, I can keep the stock wiring in a safe place and cut this wiring instead - at least I think that’s what I can do. Can you confirm this please?

Only minor faff is soldering the two pieces of wire (black and red) from the stock PCB to the mini breakout, but that’s not too bad considering this is all stock.

Many thanks again for your time,

Jamie

Oooo a female IDC good call! This will indeed work as you want it to, just remember you will only use 1 gnd. For power and gnd look for where the red and black wire of the usb cable connect and use those.

Brilliant, thanks for the confirmation. So, am I right in thinking that each one of the 8 buttons has a ground on the stock wiring, hence 16 wires? With the replacement ribbon cable, I will effectively only need to take 9 wires across - 8 for the buttons and one for ground, the rest I can just seal off?

This is my first venture into modding joysticks and it makes sense so far! Not got to the programming LED part yet, I’m sure that will make less sense. :slight_smile:

Correct the PCB takes the individual grounds and connects them to the GND plane of the board so no need to bring any other gnds.

Super! I will try to update here with my results once all the parts have arrived. If I have time, I may make a video of the install and put it on YouTube.

I’ve no doubt I’ll be back with more questions on how to get the LEDs to do what I want them to, but I have all that fun to look forward to!

Thanks again for your sage advice.

Never heard of a slip ring before, might see if I can get one of those small enough to do the job… That way might be able to fix the existing LED/harness.

ArcadeworldUK.com stock a whole joystick RGB LED configuration, so I’ve also emailed them to see if they would be able to stock just the LED part. Though they’re being slow in replying, might have to tweet them…

OK, a quick and perhaps obvious question, but before I power this all up and it explodes I thought I’d check first.

On the Kaimana Mini breakout board there are 4 breakout blocks with screw terminals, if I look at the back of the board, only one pair of these sets are labelled. I’ve used the ones that are labelled as my ā€œinputā€ (and left the ones that aren’t labelled alone), so the wiring from my stock TE2+ goes into the terminals that have the labelling.

Firstly, is this correct? Secondly, does it make a difference which of the 2 pairs of breakout blocks (with the screw terminals) I use? I only used the labelled ones as it was easier to see where each wire from the TE2+ needed to go. I presume one pair is ā€œinputā€ and the other pair is ā€œoutputā€, but I only need to use the input ones as I have the 20 pin wiring harness to go to all my buttons etc.

Hopefully this makes sense! Essentially, does it matter which pair of breakout blocks you use for input and output, and if it does matter - which pair do I use for INPUT - the labelled ones or the ones that aren’t labelled.

Lastly, on one of the breakout blocks the top label is missing, as far as I can tell this should be VCC, then it goes, DOWN, UP, LEFT RIGHT, GND, GND, HOME, SEL, START. With regards to the first ground label, I presume this is for the joystick as it is directly after the last direction, which is labelled RIGHT. I presume the 2nd GND is to match with the VCC - is this correct, or does it matter at all?

With reference to the above, I’ve taken GND and VBUS from the stock TE2+ USB connection (by soldering a black and red wire to the stock PCB), I presume these 2 wires need to go to VCC and GND as I’ve mentioned above (it’s then just a case of which of the 2 GNDs I use)?

Many thanks again!

Jamie

One final question on the orientation of the Kaimana Khameleon in relation to the mini breakout - which way round do they go?

If I look at both of them from the top of the PCBs and look at the text on both (so one says Kaimana Khameleon and has the LED connector on top, and the other has Kaimana Mini Breakout, Paradise Arcade Shop.com with the 4 blocks with screw terminals on top), I have the writing on both the correct way up (so I can read them and neither are upside down) - this is how I’ve connected them at the moment as it seems the most logical! Is this correct? There doesn’t seem to be any indication of which way around they connect.

Thanks again,

Jamie

Any ideas on the above as I need to get this sorted fairly quickly. There’s a few elements that might be the wrong way around and it’s going to help me later on if I run into trouble with the LED programming if I know the wiring is 100% correct.

Thanks.

The KK should sit on top of the Breakout like this:

http://i.imgur.com/xLmjed9l.jpg

@JRDIBBS Brilliant. Thanks for the quick confirmation - it makes sense that the writing is the same way up on both PCBs, just wanted to check first.

I’ve finally bitten the bullet and plugged it all in and it works! Apart from the joystick was upside down, but the wiring was definitely correct, so I rotated the board around the stick rather than rewire (not sure if there is a difference in how you solve this).

One thing I have noticed is that when I was testing via USB on my PC, the colours weren’t working as they should until I connected to my PS4 then they were fine. Bit hard to tell if I’ve got the right colours etc. when I can’t check it all out before connecting to PS4, but it’s no biggie. Will investigate further.

Also in answer to my own question - it doesn’t seem to make a difference which pair of breakouts you use, so using the labelled ones seems the best option as it’s more obvious where wires go without having to trace the connections on the PCB.

Will make another update once I’ve finished playing around a bit more.

OK, so I’ve got it all (Kaimana Khameleon + Kaimana Mini Breakout) hooked up to the stock TE2+ without any issues. Only had to solder 2 points from the underside of the stock PCB (GND and VBUS). Apart from some questions on which way round things connect to each other and which of the pairs of breakouts to use on the mini, it was a pretty easy install with minimal technical knowledge required. Once I get a new camera I’ll post a complete install video on YouTube.

Onto the LED programming and Arduino. What I thought would be incredibly complex and hard to understand, actually turned out to be fairly easy to use! I’ve never used Arduino before and it helped that I had something to work with when I generated the Panzer2Kaimana folder from http://brightstick.freecade.org/ - really handy having some Ryu moves and animations already there.

So I’ve modified and added to the animations, combo (special moves) etc. and now have a complete moveset for Juri SFV including V-Triggers, throws, EX moves etc. All looking pretty damn awesome! Most of them rotate between buttons and change colours, or flash on and off (so fairly simply animations).

What I would like to know is how to add a little more flare to the animations and transitions between buttons:

Is there an easy function that you add in the animations.cpp to fade individual LEDs (or the whole set)? I did look this up, but what I found seemed way too complicated just to change the brightness of LEDs in sequence.

There is also a default idle sequence (that seems to override the colours I set in the online editor at http://brightstick.freecade.org/), this animation just adds a nice fade-in fade-out animation to all buttons as it cycles through loads of colours. What I want to do is remove a couple of those colours (yellow and green) and replace them with something else. Where is this idle animation saved and where can I edit the colours used?

**Also there is a very minor issue - I have the buttons set to 2 rows of colours (purple for kick, pink for punch) when not pressed and to go white when pressed, this all works fine apart from 1 LED which is LED_K4_B - I have K4 4th in the daisy chain and it’s the right LED that switches off rather than change to white. Apart from that one issue everything works as it should. Just wondering why that one LED is turning off rather than turning white on button press?

Hopefully that all makes sense. Many thanks in advance.

Jamie

Further update - I’ve now successfully added a Tournament Mode (turns all LEDs off) when pressing a sequence of buttons, courtesy of the info here: https://github.com/javierorosario/kaimana/blob/HoldTMode/Kaimanafolder/holdingTournamentMode/holdingTournamentMode.ino so thank you to the person that programmed all this.

The one thing I’m not entirely sure about is changing how tournament mode is turned off (so all my leds come back on), at the moment it’s set to come back on with a long button press on P1, which is in the .ino file here:



 //Button hold to start tourneymode
    holdTimeout += 1;
    if(holdTimeout == 10000)
    {
      tournamentMode = true;
      tourneyModeActivate();
    }


What I actually want is to press another sequence of buttons to turn it off (which I’ve already created under combos). So how do I assign turning tournament mode off, rather than the long press on P1 (as above)?

Also, I have a question regarding some repetition in the .ino file, namely there are two blocks that are seemingly the same:

This one that starts at line 535



 // convert joystick, P1-P4, K1-K4 into a single unsigned int
  switchActivity = joystickDirection + switchActivity;
  kaimana.switchHistorySet(switchActivity);
  
 
  // test for combinations from most complext to least complex
  // test for switches in reverse order (newest to oldest)
 
 
  // combo #6
  // test for: Ultra 2 (Metsu Shoryuken)
  // combo is: DOWN, DOWN+RIGHT, RIGHT, DOWN, DOWN+RIGHT, RIGHT, RIGHT+K3
  if( kaimana.switchHistoryTest( COMBO_PATTERN_6A ) )
      animation_combo_6();
 
 
 
  // combo #5
  // test for: Ultra 1 (Metsu Hadouken)
  // combo is: DOWN, DOWN+RIGHT, RIGHT, <NONE>, DOWN, DOWN+RIGHT, RIGHT, RIGHT+P3
  if( kaimana.switchHistoryTest( COMBO_PATTERN_5A ) )
      animation_combo_5();
 
 
 
  // combo #4
  // test for: Super (Shinkuu Hadouken)
  // combo is: DOWN, DOWN+RIGHT, RIGHT, <NONE>, DOWN, DOWN+RIGHT, RIGHT, RIGHT+P1
  if( kaimana.switchHistoryTest( COMBO_PATTERN_4A ) )
      animation_combo_4();
 
 
 
  // combo #3
  // test for: Tatsumaki Senpukyaku (Hurricane Kick)
  // combo is: DOWN, DOWN+LEFT, LEFT, LEFT+K1 or LEFT+K2
  if( kaimana.switchHistoryTest( COMBO_PATTERN_3A ) )
      animation_combo_3();
  if( kaimana.switchHistoryTest( COMBO_PATTERN_3B ) )
      animation_combo_3();
 
 
 
  // combo #2
  // test for: Ryu Shoryuken (Dragon Punch)
  // combo is: RIGHT, <NONE>, DOWN, DOWN+RIGHT, DOWN+RIGHT+P1 or DOWN+RIGHT+P2
  if( kaimana.switchHistoryTest( COMBO_PATTERN_2A ) )
      animation_combo_2();
  if( kaimana.switchHistoryTest( COMBO_PATTERN_2B ) )
      animation_combo_2();
 
 
 
  // combo #1
  // test for: Ryu Hadouken (Fireball) 
  // combo is: DOWN, DOWN+RIGHT, RIGHT, RIGHT+P1 or RIGHT+P2  
  if( kaimana.switchHistoryTest( COMBO_PATTERN_1A ) )
      animation_combo_1();
  if( kaimana.switchHistoryTest( COMBO_PATTERN_1B ) )
      animation_combo_1();


Exactly the same info is also started on line 969 - why the duplication? Is it needed to be this way?

Many thanks again,

Jamie

Also found another slight issue after adding the code for Tournament Mode and not sure why this would affect the following:

I have EX moves assigned in the animations and movesets, these worked perfectly all the time when the moves were previously performed (down, down+left, left, left + LK + MK for example). Now I’ve added the Tournament Mode code they are very difficult to get to register, perhaps one in 10 time the correct animation displays for the EX move, most of the time the animation for the ā€œnormalā€ version displays instead as it seems to ignore the fact I’ve pressed two of the kick buttons along with the joystick movement.

Any ideas why this would be affected? Is this something to do with the timeout on long press or something similar? This is one of the main reasons I want to remove references to timeouts and long presses on one button, so I can just assign the Tournament Mode OFF feature to another set of button and joystick actions.

Thanks again,

Jamie

Hey dude! Im SO glad you got it to work :smiley:

First the breakout’s terminals are mirrored but only labeled on one side.

Its a strange place you linked to and thats old code, the latest code is in https://github.com/javierorosario/kaimana and from there you can find more stuff under kaimana8btn/J2s. the info below follows the code in these folders.

For fading you cant get around the complexity, but I built an idle function in the animations.cpp called breatheSine to which you only have to pass the color this only fades all the leds in and out, eg:


breatheSine(RED);
breatheSine(BLUE);


I have a new idle animation procedure I have not have the time to put into code, and an idea to how to trigger individual button fades but need time to implement.

The duplicate code is a result of laziness and not cleaning up after myself (lol), but the general idea is that you need a function to detect button presses while tournament mode is OFF (thats the pollswitches function). And you need another function to detect buttons when TMode is ON which I created by duplicating the original one (tourneypollswitches).

For the pattern you will have to determine what sequence of buttons you want to use, then create a COMBO_PATTERN using that, then call kaimana.switchHistoryTest with that combo pattern as seen in the ino. Then do the comparison like this:


  if( kaimana.switchHistoryTest( YOUR COMBO PATTERN) )
      {
      tournamentMode = true;
      tourneyModeActivate();
}


All this code aside from the default code zonbipanda wrote was built by me :smiley: I know I have to clean up but theres so much sht to be done lmao

@JRDIBBS - I thought it might be your code, but wasn’t sure, so thank you for all your hard work, it’s made my life a lot easier!

Ahhh, OK, that might help me! I’ve been Googling stuff and must have found an old link somewhere. I’ll try with the newer code and see if that solves the minor issues I have with certain EX moves not registering the animations properly.

Perfect, I saw those functions and thought they might do the job, but wasn’t sure how they worked when referencing them. That’s exactly what I’ve been looking for to add to my animations - very simple! I will have a play around and see if I can get it working.

Right, so both references to all my combos are needed - the problem I then have is that the file is too big when I include all 11 combos twice (by about 300 bytes). Is there a way of creating a shortcut reference to all my combos that are already referenced in the same file (as I have 11 of them in all)?

I don’t know the correct way to write this, but could I put in the code somewhere:



MY_COMBO_LIST = {  
// combo #1
  // test for: Ryu Shoryuken (Dragon Punch)
  // combo is: RIGHT, <NONE>, DOWN, DOWN+RIGHT, DOWN+RIGHT+P1 or DOWN+RIGHT+P2
  if( kaimana.switchHistoryTest( COMBO_PATTERN_2A ) )
      animation_combo_2();
  if( kaimana.switchHistoryTest( COMBO_PATTERN_2B ) )
      animation_combo_2();
 
  // combo #2
  // test for: Ryu Hadouken (Fireball) 
  // combo is: DOWN, DOWN+RIGHT, RIGHT, RIGHT+P1 or RIGHT+P2  
  if( kaimana.switchHistoryTest( COMBO_PATTERN_1A ) )
      animation_combo_1();
  if( kaimana.switchHistoryTest( COMBO_PATTERN_1B ) )
      animation_combo_1();}
etc. etc. etc. (including the other 9 combos)
}

And then I only have to refer to MY_COMBO_LIST instead of duplicating 11 combos again. And if I could do this, would it reduce the size of the file?

OK, that makes sense. I presume I can just delete the references to the button press on P1 and put the above code somewhere else as I’m not referencing specific buttons anymore?

I hope you can answer those few questions and thank you in advance for your help!

Jamie