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

Thanks for posting the guide. I had asked for the wiki because I wanted to know exactly what resources I should be able to get my hands on if I’m looking to start from the ground up, before asking for specific help from others (which seems to be what mainly has been going on). If the wiki doesn’t have use then that’s fine. From a customer’s perspective, the wiki seemed pretty important considering most of the actual pages link to the wiki as a resource for details.

Anyways, will work with what is available moving forward. Thanks again!

Anyone have any ideas? I’ve tried adjusting the MAIN_LOOP_DELAY value and it doesn’t seem to change anything.

EDIT: Using most colors don’t pose a problem. When I tried a darker purple, however, it caused flickering. Odd. I’ll just not use that color lol.

I just checked your guide and haven’t seen anything about setting up tournament mode. I’m pretty new to this and with the wiki being down for quite some time I don’t have many resources to start learning other than your amazing guide. When do you think you’ll have the tournament mode explanation up?

This lil mini kaimana is my favorite led setup. Cleanest setup with total programming control.

@Gummo all the original eagle cad designs are here in my GitHub repo
This was the design i was working with @armi0024 way back when.

The idea was a 20 pin connector from the get go, which big thanks go to @Phreakazoid, who provided as well as spacing, distance and footprint

Here are some original shots

http://32teeth.org/IMG_0471.jpg

http://32teeth.org/IMG_0472.jpg

@32teeth I never saw the prototype! That looks awesome! Are you going to jump back in the game! It’s been too long :slight_smile:

@gummo ty, hoping the new gui takes it even further

@Phreakazoid can’t agree with @32teeth more always a resource

I’ll have to pick up another set at Combo Breaker. I didn’t have enough time to properly implement the button smashing temp effect I wanted to do. Had to get what I had done and shipped out today.

It will give me a good reason to update my personal giantsword stick.

Panzer with kaimana and tournament mode :slight_smile:

Ok I just got the new Kaimana J2s but there is a major issue. Each Kalimana J2 has 2 LEDs And of course each Kaimana J2 fits on one button. the problem is that it’s treating the 2 LEDs as 2 separate buttons. So when I press button2, LED 2 on button one lights up. When I press button3, LED1 on button2 lights up. When I press button4, LED2 on button 2 lights up and so on. I’m sure this could be fixed in software, but that’s way over my head. what a freaking headache.

Go to brightstick.freecade.org like I suggested in the PAS thread and use that software to start. The Js were redesigned and are more like the PFS2 LEDS on the system of systems now.

Seriously, at this point I wish I could just get some old Kaimana Js. I’m using a hit box I had my Kaimana working pretty good with pele LEDs and indexers, but it’s a plexiglass box and the wiring was a mess. I wanted to clean it up with the Js. after already getting a bunch of old wires I find out that the wires are different now. I order wires and they forget to include the pcb to Kaimana j wire. I made my own and run into the issue with the LEDs being indexed weird. I thought maybe I wires it wrong so I reversed 2 wires and fried 2 of my j2s. Honestly wish they left the Js the way they were. Why in the world are the 2 LEDs for the same button indexed separately?

The old js could be set up separately as well. This method is more to spec and matches the lvt3 and panzer style. I can help clean up your code if needed.

@fluffhead - because they are now 100% setup as intended by the manufacturer of the LED itself. Indeed the shift makes a transition tough, but it offers a lot more control. Mixing colors on each button comes to mind as the first benefit, and the simplified no screw up wiring is the second.

@armi0024 how can I get you my old code to be fixed. or hitbox code from scratch. I want to use 12 Kaimana J2s for the directions and action buttons. I’m not using LEDs for start/select/home

what are the chances of making that software work with hitbox style controllers?

When my PFS2.0 Hitbox layout is finished and working properly. Honestly, you can very easily and in about 5 minutes adapt the downloaded code to work with a Hitbox. Its actually VERY SIMPLE to do.

Here’s some help since you seem to have some trepidations to try it on your own (you can’t break it… trust me):

In the example.ino file (first file in the tab in arudino ide):

find // read arduino pins and ave results in the mapped LED if button pressed (pin grounded)

Under that there should be a bunch of lines for Joystick cases and another line under it a nother //read arduino pins… entry.

Delete everything between the comments.

Replace with the following:



 // read arduino pins and save results in the mapped LED if button is pressed (pin grounded)

  if(!digitalRead(PIN_UP))
  {
    // switch is active
    if(iLED[LED_UP] == true)
    {
      //maintain color while switch is active
      iLED[LED_UP] = true;
    }
    else
    {
      // select new color when switch is first activated
      #ifdef RANDOM_COLOR_UP_ON      
        setLEDRandomColor(LED_UP);  
      #else
         kaimana.setLED(LED_UP, LED_UP_COLOR_ON);
      #endif
      iLED[LED_UP] = true;
    }
  }
  else
  {
      // switch is inactive
      #ifdef RANDOM_COLOR_UP_OFF
        setLEDRandomColor(LED_UP);
      #else
        kaimana.setLED(LED_UP, LED_UP_COLOR_OFF);
      #endif    
      iLED[LED_UP] = false;
  }

  if(!digitalRead(PIN_DOWN))
  {
    // switch is active
    if(iLED[LED_DOWN] == true)
    {
      //maintain color while switch is active
      iLED[LED_DOWN] = true;
    }
    else
    {
      // select new color when switch is first activated
      #ifdef RANDOM_COLOR_DOWN_ON      
        setLEDRandomColor(LED_DOWN);  
      #else
         kaimana.setLED(LED_DOWN, LED_DOWN_COLOR_ON);
      #endif
      iLED[LED_DOWN] = true;
    }
  }
  else
  {
      // switch is inactive
      #ifdef RANDOM_COLOR_DOWN_OFF
        setLEDRandomColor(LED_DOWN);
      #else
        kaimana.setLED(LED_DOWN, LED_DOWN_COLOR_OFF);
      #endif    
      iLED[LED_DOWN] = false;
  }

  
    if(!digitalRead(PIN_LEFT))
  {
    // switch is active
    if(iLED[LED_LEFT] == true)
    {
      //maintain color while switch is active
      iLED[LED_LEFT] = true;
    }
    else
    {
      // select new color when switch is first activated
      #ifdef RANDOM_COLOR_LEFT_ON      
        setLEDRandomColor(LED_LEFT);  
      #else
         kaimana.setLED(LED_LEFT, LED_LEFT_COLOR_ON);
      #endif
      iLED[LED_LEFT] = true;
    }
  }
  
  if(!digitalRead(PIN_RIGHT))
  {
    // switch is active
    if(iLED[LED_RIGHT] == true)
    {
      //maintain color while switch is active
      iLED[LED_RIGHT] = true;
    }
    else
    {
      // select new color when switch is first activated
      #ifdef RANDOM_COLOR_RIGHT_ON      
        setLEDRandomColor(LED_RIGHT);  
      #else
         kaimana.setLED(LED_RIGHT, LED_RIGHT_COLOR_ON);
      #endif
      iLED[LED_RIGHT] = true;
    }
  }
  else
  {
      // switch is inactive
      #ifdef RANDOM_RIGHT_HOME_OFF
        setLEDRandomColor(LED_RIGHT);
      #else
        kaimana.setLED(LED_RIGHT, LED_RIGHT_COLOR_OFF);
      #endif    
      iLED[LED_RIGHT] = false;
  }



Next, go over to kaimana_custom.h and replace everything with the following:



//  kaimana_custom.h Generated from jasensCustoms.com Kaimana Khameleon Code Generator
//  KK Code Generator: http://brightstick.freecade.org
//  Code is provided for entertainment purposes and use with the Kaimana Khameleon and Panzer Fight Stick 2.
//  Code may be copied, modified, resused with this Copyright notice.
//
//  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
//  THE SOFTWARE.
//
//  Based on code originally released by ParadiseArcadeShop.com
//  Generator Created:  November 4, 2015    jasenhicks // jasenscustoms.com -- Cavalier Mannitude Encouragement
//
// THIS FILE GENERATED ON: Friday 18th of March 2016 07:32:28 PM


#ifndef __kaimana_local_h__
#define __kaimana_local_h__
#define __PROG_TYPES_COMPAT__
#include <avr/io.h>
#include <avr/pgmspace.h>
#include "Arduino.h"
#include "kaimana.h"

//ON BUTTON STATE

#define LED_UP_COLOR_ON 127,0,220
#define LED_DOWN_COLOR_ON 127,0,220
#define LED_LEFT_COLOR_ON 127,0,220
#define LED_RIGHT_COLOR_ON 127,0,220
#define LED_P1_COLOR_ON 127,0,220
#define LED_P2_COLOR_ON 127,0,220
#define LED_P3_COLOR_ON 127,0,220
#define LED_P4_COLOR_ON 127,0,220
#define LED_K1_COLOR_ON 127,0,220
#define LED_K2_COLOR_ON 127,0,220
#define LED_K3_COLOR_ON 127,0,220
#define LED_K4_COLOR_ON 127,0,220
#define LED_SELECT_COLOR_ON 127,0,220
#define LED_HOME_COLOR_ON 127,0,220
#define LED_START_COLOR_ON 127,0,220


//OFF BUTTON STATE 
#define LED_UP_COLOR_OFF 127,220,0
#define LED_DOWN_COLOR_OFF 127,220,0
#define LED_LEFT_COLOR_OFF 127,220,0
#define LED_RIGHT_COLOR_OFF 127,220,0
#define LED_P1_COLOR_OFF 127,220,0
#define LED_P2_COLOR_OFF 127,220,0
#define LED_P3_COLOR_OFF 127,220,0
#define LED_P4_COLOR_OFF 127,220,0
#define LED_K1_COLOR_OFF 127,220,0
#define LED_K2_COLOR_OFF 127,220,0
#define LED_K3_COLOR_OFF 127,220,0
#define LED_K4_COLOR_OFF 127,220,0
#define LED_SELECT_COLOR_OFF 127,220,0
#define LED_HOME_COLOR_OFF 127,220,0
#define LED_START_COLOR_OFF 127,220,0


//RANDOM COLORS SET
#define COLOR_RANDOM_1 255,0,0
#define COLOR_RANDOM_2 255,255,0
#define COLOR_RANDOM_3 255,255,255
#define COLOR_RANDOM_4 0,0,255
#define COLOR_RANDOM_5 0,255,255
#define COLOR_RANDOM_6 255,0,255
#define COLOR_RANDOM_7 127,255,0
#define COLOR_RANDOM_8 255,0,127
  
//BOOT AND IDLE SEQUENCE TIMING
#define  BOOT_COLOR_DELAY         250
#define  BOOT_COMPLETE_DELAY      500
#define  MAIN_LOOP_DELAY           50
#define IDLE_TIMEOUT_SECONDS       10
#define IDLE_ANIMATION_DELAY       8
  
//LED INDEX
#define  LED_UP       0
#define  LED_UP_B     1
#define  LED_K1       2        
#define  LED_K1_B     3  
#define  LED_K2       4  
#define  LED_K2_B     5 
#define  LED_K3       6 
#define  LED_K3_B     7 
#define  LED_K4       8 
#define  LED_K4_B     9 
#define  LED_P4       10 
#define  LED_P4_B     11
#define  LED_P3       12
#define  LED_P3_B     13
#define  LED_P2       14    
#define  LED_P2_B     15
#define  LED_P1       16
#define  LED_P1_B     17
#define  LED_RIGHT    18
#define  LED_RIGHT_B  19
#define  LED_DOWN     20
#define  LED_DOWN_B   21
#define  LED_LEFT     22
#define  LED_LEFT_B   23
#define  LED_SELECT   24
#define  LED_SELECT_B 25  
#define  LED_HOME     26
#define  LED_HOME_B   27
#define  LED_START    28
#define  LED_START_B  29

#define  LED_COUNT    30

#endif



Change your indexes to match how you wired your LEDs up. If you don’t have START/HOME/SELECT wired up with LEDs, leave them in the code, just keep it at the end with the final 6 numbers. Set your LED COUNT to 24 since you have 12x buttons with a Kaimana J on each that has 2 LEDs. Please note I I don’t know exactly how the Js are setup so if you notice a button is pressed and a light on one button lights as well as the a light on the next button, swap your index numbers for everything. Meaning, if you press UP and UP has one of the LEDs light up and then say K1 has one of the buttons light up, that means you need to make LED_UP 1 and LED_UP_B 0; and so forth.

There is a little bit of ownership required on the end user to get these setup. I think more help from the community would be given if there were some statements in your questions like “Hey, I tried this… XYZ and noticed that the LEDs are doing ABC. So I swapped this around in code and it didn’t help. Any thoughts?” It’s hard to must up the desire to help out if someone isn’t at least willing to try something out first.


// switch is active
    if(iLED[LED_UP] == true)
    {
      //maintain color while switch is active
      iLED[LED_UP] = true;
    }

This code makes me laugh. But I can’t wait to get my J2s and start experimenting with the code.

Way back when, we had actually solved the double data on the buttons by isolating a single data line
Heres my instagram from 2012

https://instagram.com/p/OhhpC3yrCB/

Wow. I really really do appreciate your help, but a little less condescension would be nice. There was no “trepidation” on my part whatsoever. I happen to have very little experience with computer code, yet I downloaded the code from your site and sifted
though it and I’m sorry if I’m not as smart as you, but I did not find it “VERY SIMPLE” at all. I had previously managed to get an old Hitbox code working with Pele LEDs and indexers, and admittedly expressed some frustration at the change in the Kaimana J2s, but when asking for help with the code I just asked in a straightforward manner. I don’t think it should have been misinterpreted as being entitled or demanding or me being helpless. Anyway like I said I do appreciate the help.

Did it work? I’m not a coder by any means, but this is all in pretty plain english, thats the great thing about Arduino. It takes some time to look through the code and understand whats going on, there was no real indication that you did that, hence the frustration in my answer. It’s not personal, but those that have been around a while and answered these questions in the past get frustrated when people don’t use the search function or seem to have tried anything first because it comes across poorly.