Community Event / Creation Project Name: Desk Top SimPit (D.S.P)

Awesome work! I'm looking at your schematic that you posted, there does not appear to be any switch debouncing (hardware-wise). Are you handling that in software, or is there some debouncing built into the MCP23017?

Edit: I'm blind, I see you have delay(200) in your code.

I'm planning a control panel myself, but I think that to make it expandable, using a loop to poll each input would be too long, especially as the number of inputs grows. I'd like to use interrupts, but that means no delay function (they use the same timer, I think.)
 
Last edited:
Awesome work! I'm looking at your schematic that you posted, there does not appear to be any switch debouncing (hardware-wise). Are you handling that in software, or is there some debouncing built into the MCP23017?

Edit: I'm blind, I see you have delay(200) in your code.

I'm planning a control panel myself, but I think that to make it expandable, using a loop to poll each input would be too long, especially as the number of inputs grows. I'd like to use interrupts, but that means no delay function (they use the same timer, I think.)


Hey netwolfx, Welcome to the thread.

that code posted above is a little out dated now lol, I have just finalized my code "updating" last night its much cleaner now (IMHO). I'll be posing it and the final wiring diagrams soon...

I was unfortunately having difficulty getting the interrupt function to work reliably (it can be done... just not by me lol), so you wont see it in my published works.
As to the denouncing: it seems that a : delay(175); works well, especially for my rotary encoders I can spin them fast and the code wont miss a single click.




As to the loop polling time :

yes you are correct in concept, the more inputs the longer the loop would take. HOWEVER my loop still completes in micro seconds, so for now this "lag" is NOT seen... thus allowing me to take this simple approach...





If you do start a build PM me your thread link, i would love to follow a new project !
 
i have decided that if they ever release an API for this game (allowing for more custom immersion) i will build a Battlestar Galactica Viper MK II or MK IV sim pit for ED.... with consoles and touch screen integration....


(random post now complete )
 
Hey folks... as promised here are some updates.... I wrapped everything in a spoiler tag to make this post more readable


-----------------------------Arduino Code:-----------------------------

This is my current code that I have had full success with (for my design)

***NOTE I still need to assign the correct keys for ED ... everything is currently just set to abc ect...


if anyone has ideas for improvement, I would be very happy to know it. :)

Left Console:


Code:
/*
    Programm: D.S.P Left Console
    Author: CMD_B34R
    Date: 22 Sep 2016


    This programm has been written to allow for keyboard emulation via switches, buttons, and rotary encoders.
    An Arduino Pro Micro (clone) and multipule MCP23017(s) IC(s) are being used to allow for I/O port expantion.
*/  
  
/* 
    THIS SECTION WILL DETAIL BUTTION / PIN LAYOUT FOR BUTTON TRACKING (TRACE MATRIX)


    MCP # PIN #   | PROGRAMM FUNCTION   | IN/OUT  | SWITCH TYPE     | KEYBOARD CHAR 
   |--------------------------------------------------------------------------------|
    MCP 1 PIN 0   | Galaxy Map             | INPUT   | PUSH BUTTON    | a 
    
    MCP 1 PIN 1   | System Map            | INPUT   | PUSH BUTTON    | a 


    MCP 1 PIN 2   | Next System         | INPUT   | PUSH BUTTON    | b
    
    MCP 1 PIN 3   | Request docking     | INPUT   | PUSH BUTTON    | b


    MCP 1 PIN 4   | Wing Nav Lock       | INPUT   | PUSH BUTTON    | c
    
    MCP 1 PIN 5   | F.S.D                  | INPUT   | PUSH BUTTON    | d


    MCP 1 PIN 6   | AU1                  | INPUT   | PUSH BUTTON    | e
    MCP 1 PIN 7   | Aux2                | INPUT   | PUSH BUTTON    | f
    MCP 1 PIN 8   | Aux3                | INPUT   | PUSH BUTTON    | g
   
    MCP 1 PIN 9   | Power Reset          | INPUT   | PUSH BUTTON    | h
    MCP 1 PIN 10  | Power Wep             | INPUT   | PUSH BUTTON    | i
    MCP 1 PIN 11  | Power Sys              | INPUT   | PUSH BUTTON    | j 
    MCP 1 PIN 12  | Power Eng              | INPUT   | PUSH BUTTON    | k
    
    MCP 1 PIN 13  | Flight Assist       | INPUT   | PUSH BUTTON    | l  
    
*/






#include <Keyboard.h>                                            // This lib will handdle the keyboard emulation
#include <Wire.h>                                             // This lib will handdle the I2C communication
#include "Adafruit_MCP23017.h"                                // This lib will handdle the MCP23017




Adafruit_MCP23017 mcp1;                                       // defines MCP23017 IC 1 (Per the "Adafruit_MCP23017.h" lib)




int led;                                                      // a variable to hold the id of the LED that will be toggled
int MCP1Array[16] = {};                                       // an array to hold the values from the 1st MC23017
char KeyArray1[] = "abcdefghijklmopq";                        // an array to hold the keystoke char(s)


void setup() 
{
  Serial.begin(9600);                                         // Start serial com for debuging
  Keyboard.begin();                                           // Starts the keyboard emulation 
  mcp1.begin(0);                                              // Starts / IDs 1st MCP23017 Chip with Address 0


  for(int i = 0; i<15; i++)
  {
    mcp1.pinMode(i, INPUT);                                   // Sets pins 0-15 on the MCP1 as an input
    mcp1.pullUp(i, HIGH);                                     // Turn on a 100K pullup internally
  }
}




void loop() 
{
  for (int PIN = 0; PIN<=15; PIN++)                           // for loop to investigate the state of the 1st MCP23017 chip pins 0 to 15
    {              
        if(MCP1Array[PIN] != mcp1.digitalRead(PIN))           // if the MCP1Array dose NOT = the acutal (read) state of the MCP23017 then...
        {
          MCP1Array[PIN]= mcp1.digitalRead(PIN);              // update the array with the current value(s)
          if (MCP1Array[PIN]== 0)                             // If (PIN) == 0 then the button at that pin location was pressed/toggled...
          {
            char k = KeyArray1[PIN];                          // char k will = the char value (at position [PIN]) from  KeyArray1 
            Keyboard.write(k);                                // and then keyboard.write the value (at position [PIN]) from KeyArray1
             
            Serial.println ("");                              // used for debuging
            Serial.print ("You pressed a button at PIN# ");   // used for debuging
            Serial.println (PIN);                             // used for debuging                                              
            }
        }
    }
}



Center Console:

Code:
/*
    Programm: D.S.P Center Console
    Author: CMD_B34R
    Date: 22 Sep 2016


    This programm has been written to allow for keyboard emulation via switches, buttons, and rotary encoders.
    An Arduino Pro Micro (clone) and multipule MCP23017(s) IC(s) are being used to allow for I/O port expantion.
*/  
  
/* 
    THIS SECTION WILL DETAIL BUTTION / PIN LAYOUT FOR BUTTON TRACKING (TRACE MATRIX)


    MCP # PIN #   | PROGRAMM FUNCTION   | IN/OUT  | SWITCH TYPE     | KEYBOARD CHAR 
   |--------------------------------------------------------------------------------|
    MCP 1 PIN 0   | Chaff                  | INPUT   | TOGGLE SWITCH   | a 
    MCP 1 PIN 1   | Chaff                 | INPUT   | TOGGLE SWITCH   | a 


    MCP 1 PIN 2   | Shield Cell         | INPUT   | TOGGLE SWITCH   | b
    MCP 1 PIN 3   | Shield Cell         | INPUT   | TOGGLE SWITCH   | b


    MCP 1 PIN 4   | Heat Sync           | INPUT   | TOGGLE SWITCH   | c
    MCP 1 PIN 5   | HEat Sync           | INPUT   | TOGGLE SWITCH   | c


    MCP 1 PIN 6   | Silent Running      | INPUT   | TOGGLE SWITCH   | d
    MCP 1 PIN 7   | Silent Running        | INPUT   | TOGGLE SWITCH   | d


    MCP 1 PIN 8   | Fire Control Group  | INPUT   | Rotary Encoder  | e 
    MCP 1 PIN 9   | Fire Control Group  | INPUT   | Rotary Encoder  | e
    MCP 1 PIN 10  |  null                 | INPUT   | Rotary Encoder  | ???
   
    MCP 1 PIN 11  | Fire Control Group  | INPUT   | Rotary Encoder  | f 
    MCP 1 PIN 12  | Fire Control Group  | INPUT   | Rotary Encoder  | f
    MCP 1 PIN 13  |  null                 | INPUT   | Rotary Encoder  | ???
  


    MCP 2 PIN 0   | INDICATION LED      | OUTPUT  |   N/A           |   N/A
    MCP 2 PIN 1   | INDICATION LED      | OUTPUT  |   N/A           |   N/A
    MCP 2 PIN 2   | INDICATION LED      | OUTPUT  |   N/A           |   N/A
    MCP 2 PIN 3   | INDICATION LED      | OUTPUT  |   N/A           |   N/A
    


    MCP 2 PIN 4   | Fire Control Group  | INPUT   | Rotary Encoder  | g 
    MCP 2 PIN 5   | Fire Control Group  | INPUT   | Rotary Encoder  | g
    MCP 2 PIN 6   |  null                 | INPUT   | Rotary Encoder  | ???
  
    MCP 2 PIN 7   | Fire Control Group  | INPUT   | Rotary Encoder  | h 
    MCP 2 PIN 8   | Fire Control Group  | INPUT   | Rotary Encoder  | h
    MCP 2 PIN 9   |  null                 | INPUT   | Rotary Encoder  | ???
  
    MCP 2 PIN 10  | Fire Control Group  | INPUT   | Rotary Encoder  | i 
    MCP 2 PIN 11  | Fire Control Group  | INPUT   | Rotary Encoder  | i
    MCP 2 PIN 12  |  null                | INPUT   | Rotary Encoder  | ??? 
    
    MCP 2 PIN 13  | Highest Threat      | INPUT   | PUSH BUTTON     | j
    
    MCP 2 PIN 14  | WingMans Target     | INPUT   | PUSH BUTTON     | k


*/






#include <Keyboard.h>                                           // This lib will handdle the keyboard emulation
#include <Wire.h>                                             // This lib will handdle the I2C communication
#include "Adafruit_MCP23017.h"                                // This lib will handdle the MCP23017




Adafruit_MCP23017 mcp1;                                       // defines MCP23017 IC 1 (Per the "Adafruit_MCP23017.h" lib)
Adafruit_MCP23017 mcp2;                                       // defines MCP23017 IC 2 (Per the "Adafruit_MCP23017.h" lib)




int led;                                                      // a variable to hold the id of the LED that will be toggled
int MCP1Array[17] = {};                                       // an array to hold the values from the 1st MC23017
int ALEDArray[] = {0,0,0,0};                                  // an array to hold the state A values for the 2nd MC23017 (Senario A aka starting state) 
int BLEDArray[] = {1,1,1,1};                                  // an array to hold the state B values for the 2nd MC23017 (Senario B aka alt state) 
int CLEDArray[] = {0,0,0,0};                                  // an array to hold the Current LED State for the 2nd MC23017 (starting values listed)
char KeyArray1[] = "abcdefghijklmopq";                        // an array to hold the keystoke char(s)
char KeyArray2[] = "rstuvwxyz";      


void setup() 
{
  Serial.begin(9600);                                         // Start serial com for debuging
  Keyboard.begin();                                           // Starts the keyboard emulation 
  mcp1.begin(0);                                              // Starts / IDs 1st MCP23017 Chip with Address 0
  mcp2.begin(1);                                              // Starts / IDs 2nd MCP23017 Chip with Address 1


  for(int i = 0; i<15; i++)
  {
    mcp1.pinMode(i, INPUT);                                   // Sets pins 0-15 on the MCP1 as an input
    mcp1.pullUp(i, HIGH);                                     // Turn on a 100K pullup internally
  }
  
  for(int i = 0; i<=3; i++)
  {
    mcp2.pinMode(i, OUTPUT);                                  // Sets pins 0-3 on the MCP2 as an output     
  } 
  
  for(int i = 4; i<15; i++)
  {
    mcp2.pinMode(i, INPUT);                                   // Sets pins 4-15 on the MCP2 as an input
    mcp2.pullUp(i, HIGH);                                     // Turn on a 100K pullup internally
  }
}




void loop() 
{
  for (int PIN = 0; PIN<=15; PIN++)                           // for loop to investigate the state of the 1st MCP23017 chip pins 0 to 15
  {              
    if(MCP1Array[PIN] != mcp1.digitalRead(PIN))               // if the MCP1Array dose NOT = the acutal (read) state of the MCP23017 then...
    {
      MCP1Array[PIN]= mcp1.digitalRead(PIN);                  // update the array with the current value(s)
      if (MCP1Array[PIN]== 0)                                 // If (PIN) == 0 then the button at that pin location was pressed/toggled...
      {
        char k = KeyArray1[PIN];                              // char k will = the char value (at position [PIN]) from  KeyArray1 
        Keyboard.write(k);                                    // and then keyboard.write the value (at position [PIN]) from KeyArray1
         
        Serial.println ("");                                  // used for debuging
        Serial.print ("You pressed the button at PIN # ");    // used for debuging
        Serial.println (PIN);                                 // used for debuging
        
        if (PIN<=5)                                           // if the button was pressed at PIN# 0 to PIN# 6 then...
        {
          if ( PIN == 0)                                      // if PIN location was PIN # 0 then...
          {
            led = 0;
            Serial.print ("PIN was == 0");
          }
          else if ( PIN % 2 == 0)                             // if PIN location was is even # pin then... (pin / 2 should have no remander if PIN was even)
          {
            led = (PIN/2);                                    // led = pin /2 (a variable to hold the id of the LED that will be toggled)
            Serial.println ("PIN was even");                  // used for debuging
          }
          else if ( PIN%2 !=0)                                // if PIN location was is odd # pin then... 
          {
            led = ((PIN - 1) / 2);                            // then ((pin -1) / 2) = led (a variable to hold the id of the LED that will be toggled)
            Serial.println ("PIN was odd");                   // used for debuging
          } 
           
          Serial.print ("led =");                             // used for debuging
          Serial.println (led);                               // used for debuging    


          mcp2.digitalWrite(led,1);                           // This will write the values from the CLEDArray index [led] as an output to the 2nd MCP 23017 Chip turning on or off the LED attached to that pin (the 2nd mcp chip is used as a LED driver)  
          delay (1000);                                       // delay for blink
          mcp2.digitalWrite(led,0);                           // turn led off for blink affect
        }
        
        if (PIN==6 || PIN == 7)                               // if the button at pin location 6 or 7 was pressed then...
        {
          if (CLEDArray[3] == ALEDArray[3])                   // if CLEDArray == ALEDArray then...
          {
            CLEDArray[3] = BLEDArray[3];                      // toggle the state of the CLEDArray from A to B
          }
          else                                                // if CLEDArray == BLEDArray then...
          {
            CLEDArray[3] = ALEDArray[3];                      // toggle the state of the CLEDArray from B to A
          }
          mcp2.digitalWrite(3,CLEDArray[3]);                  // send the current value of the array index 3 to the 2nd MCP23017 chip (pin 3)
        }
      }                                                                                  
    }
  }
}


Right Console:

Code:
/*
    Programm: D.S.P Right Console
    Author: CMD_B34R
    Date: 15 Sep 2016


    This programm has been written to allow for keyboard emulation via switches, buttons, and rotary encoders.
    An Arduino Pro Micro (clone) and multipule MCP23017(s) IC(s) are being used to allow for I/O port expantion.
*/  
  
/* 
    THIS SECTION WILL DETAIL BUTTION / PIN LAYOUT FOR BUTTON TRACKING (TRACE MATRIX)


    MCP # PIN #   | PROGRAMM FUNCTION   | IN/OUT  | SWITCH TYPE     | KEYBOARD CHAR 


    MCP 1 PIN 0   | FLOOD LIGHTS ON     | INPUT   | TOGGLE SWITCH   | a 
    MCP 1 PIN 1   | FLOOD LIGHTS OFF    | INPUT   | TOGGLE SWITCH   | a 


    MCP 1 PIN 2   | ORBIT LINES TOGGLE  | INPUT   | TOGGLE SWITCH   | b
    MCP 1 PIN 3   | ORBIT LINES TOGGLE  | INPUT   | TOGGLE SWITCH   | b


    MCP 1 PIN 4   | ROTATION ADJ TOGGLE | INPUT   | TOGGLE SWITCH   | c
    MCP 1 PIN 5   | ROTATION ADJ TOGGLE | INPUT   | TOGGLE SWITCH   | c


    MCP 1 PIN 6   | LANDING GEAR UP     | INPUT   | TOGGLE SWITCH   | d
    MCP 1 PIN 7   | LANDING GEAR DOWN   | INPUT   | TOGGLE SWITCH   | d


    MCP 1 PIN 8   | CARGO SCOOP CLOSE   | INPUT   | TOGGLE SWITCH   | e 
    MCP 1 PIN 9   | CARGO SCOOP OPEN    | INPUT   | TOGGLE SWITCH   | e


    MCP 1 PIN 10  | CARGO EJECT DUMP    | INPUT   | TOGGLE SWITCH   | f
    MCP 1 PIN 10  | CARGO EJECT DUMP    | INPUT   | TOGGLE SWITCH   | f                        <<<=  tie switch 11 into switch 10


    MCP 1 PIN 11  | RADAR INCEASE       | INPUT   | PUSH BUTTON     | g 
    
    MCP 1 PIN 12  | RADAR DECREASE      | INPUT   | PUSH BUTTON     | h
    
    MCP 1 PIN 13  | PTT                 | INPUT   | PUSH BUTTON     | i
    
    MCP 1 PIN 14  | ABORT               | INPUT   | PUSH BUTTON     | j
    
    MCP 1 PIN 15  | EJECT               | INPUT   | PUSH BUTTON     | k




    MCP 2 PIN 0   | INDICATION LED      | OUTPUT  |   N/A           |   N/A
    MCP 2 PIN 1   | INDICATION LED      | OUTPUT  |   N/A           |   N/A
    MCP 2 PIN 2   | INDICATION LED      | OUTPUT  |   N/A           |   N/A
    MCP 2 PIN 3   | INDICATION LED      | OUTPUT  |   N/A           |   N/A
    MCP 2 PIN 4   | INDICATION LED      | OUTPUT  |   N/A           |   N/A
    MCP 2 PIN 5   | INDICATION LED      | OUTPUT  |   N/A           |   N/A 
    MCP 2 PIN 6   | INDICATION LED      | OUTPUT  |   N/A           |   N/A 
    MCP 2 PIN 7   | INDICATION LED      | OUTPUT  |   N/A           |   N/A
  */




#include <Keyboard.h>                                                                  // This lib will handdle the keyboard emulation
#include <Wire.h>                                                                   // This lib will handdle the I2C communication
#include "Adafruit_MCP23017.h"                                                      // This lib will handdle the MCP23017




Adafruit_MCP23017 mcp1;                                                                // defines MCP23017 IC 1 (Per the "Adafruit_MCP23017.h" lib)
Adafruit_MCP23017 mcp2;                                                                // defines MCP23017 IC 2 (Per the "Adafruit_MCP23017.h" lib)




int led;                                                                            // a variable to hold the id of the LED that will be toggled
int MCP1Array[17] = {};                                                                   // an array to hold the values from the 1st MC23017
int ALEDArray[] = {1,1,1,0,1,1,0,0};                                                  // an array to hold the state A values for the 2nd MC23017 (Senario A aka starting state) 
int BLEDArray[] = {0,0,0,1,0,0,1,1};                                                  // an array to hold the state B values for the 2nd MC23017 (Senario B aka alt state) 
int CLEDArray[] = {1,1,1,0,1,1,0,0};                                                  // an array to hold the Current LED State for the 2nd MC23017 (starting values listed)
char KeyArray1[] = "abcdefghijklmopq";                                                // an array to hold the keystoke char(s)
       


void setup() 
{
    Serial.begin(9600);                                                                // Start serial com for debuging
    Keyboard.begin();                                                                    // Starts the keyboard emulation 
    mcp1.begin(0);                                                                   // Starts / IDs 1st MCP23017 Chip with Address 0
    mcp2.begin(1);                                                                   // Starts / IDs 2nd MCP23017 Chip with Address 1


    for(int i = 0; i<15; i++)
    {
        mcp1.pinMode(i, INPUT);                                                      // Sets pins 1-16 on the MCP1 as an input
        mcp1.pullUp(i, HIGH);                                                        // Turn on a 100K pullup internally
    }
  
    for(int i = 0; i<8; i++)
    {
        mcp2.pinMode(i, OUTPUT);                                                     // Sets pins 1-9 on the MCP2 as an output     
    } 
}




void loop() 
{
    for (int PIN = 0; PIN<=15; PIN++)                                               // for loop to investigate the state of the 1st MCP23017 chip pins 0 to 15
    {              
        if(MCP1Array[PIN] != mcp1.digitalRead(PIN))                                    // if the MCP1Array dose NOT = the acutal (read) state of the MCP23017 then...
        {
            MCP1Array[PIN]= mcp1.digitalRead(PIN);                                    // update the array with the current value(s)
            if (MCP1Array[PIN]== 0)                                                    // If (PIN) == 0 then the button at that pin location was pressed/toggled...
            {
                char k = KeyArray1[PIN];                                             // char k will = the char value (at position [PIN]) from  KeyArray1 
                Keyboard.write(k);                                                   // and then keyboard.write the value (at position [PIN]) from KeyArray1
                 
                Serial.println ("");                                                  // used for debuging
                Serial.print ("You pressed the button at PIN # ");                      // used for debuging
                Serial.println (PIN);                                                // used for debuging
                
                if (PIN<=6)                                                            // if the button was pressed at PIN# 0 to PIN# 6 then...
                {
                    if ( PIN == 0)                                                    // if PIN location was PIN # 0 then...
                    {
                        led = 0
                        Serial.print ("PIN was == 0")
                    }
                    else if ( PIN % 2 == 0)                                            // if PIN location was is even # pin then... (pin / 2 should have no remander if PIN was even)
                    {
                        led = (PIN/2);                                                // led = pin /2 (a variable to hold the id of the LED that will be toggled)
                        Serial.println ("PIN was even");                            // used for debuging
                    }
                    else if ( PIN%2 !=0)                                            // if PIN location was is odd # pin then... 
                    {
                        led = ((PIN - 1) / 2);                                        // then ((pin -1) / 2) = led (a variable to hold the id of the LED that will be toggled)
                        Serial.println ("PIN was odd");                                // used for debuging
                    }    
                     
                        Serial.print ("led =");                                        // used for debuging
                        Serial.println (led);                                        // used for debuging        
                     
                    if (CLEDArray[led] == ALEDArray[led])                            // if CLEDArray index posision [led] == ALEDArray index position [led] then...
                    {
                        CLEDArray[led] = BLEDArray[led];                            // then toggle CLEDArray index led from ALEDArray to BLEDArray
                    }
                    else                                                            // if CLEDArray index posision [led] == BLEDArray index position [led] then...
                    {
                        CLEDArray[led] = ALEDArray[led];                            // toggle CLEDArray index [led] from BLEDArray to ALEDArray
                    }
                    
                    Serial.print("This is the state of the CLEDArray: ");            // used for debuging                               
                    for (int L=0; L<=7; L++)                                        // used for debuging
                    {
                        Serial.print(CLEDArray[L]);                                 // used for debuging
                        Serial.print(" |");                                            // used for debuging
                    }


                    mcp2.digitalWrite(led,CLEDArray[led]);                           // This will write the values from the CLEDArray index [led] as an output to the 2nd MCP 23017 Chip turning on or off the LED attached to that pin (the 2nd mcp chip is used as a LED driver)  
                }
                
                if (PIN>=7)                                                            // if the button was pressed at PIN# 7 to PIN# 16 then...
                {
                    switch (PIN)                                                    // This switch case will handle the LEDs that require "Special" conditions
                    {
                        case 7:                                                        // if pin 7 was pressed turn led 4 on and led 3 off and write the value to the 2nd MCP23017 chip
                                CLEDArray[4] = 1;                                    
                                mcp2.digitalWrite(4, CLEDArray[4]);                
                                CLEDArray[3] = 0;
                                mcp2.digitalWrite(3, CLEDArray[3]);
                                Serial.print (CLEDArray[4]);                        // used for debugging
                                Serial.print (" ");                                    // used for debugging
                                Serial.println (CLEDArray[3]);                        // used for debugging
                                break;
                        case 8:                                                        // if pin 9 was pressed turn led 6 on and led 5 off and write the value to the 2nd MCP23017 chip
                                CLEDArray[6] = 0;                                    
                                mcp2.digitalWrite(6, CLEDArray[6]);
                                CLEDArray[5] = 1;
                                mcp2.digitalWrite(5, CLEDArray[5]);
                                Serial.print (CLEDArray[5]);                        // used for debugging
                                Serial.print (" ");                                    // used for debugging
                                Serial.print (CLEDArray[6]);                        // used for debugging
                                break;
                        case 9:                                                        // if pin 9 was pressed turn led 6 on and led 5 off and write the value to the 2nd MCP23017 chip
                                CLEDArray[6] = 1;                                    
                                mcp2.digitalWrite(6, CLEDArray[6]);
                                CLEDArray[5] = 0;
                                mcp2.digitalWrite(5, CLEDArray[5]);
                                Serial.print (CLEDArray[5]);                        // used for debugging
                                Serial.print (" ");                                    // used for debugging
                                Serial.print (CLEDArray[6]);                        // used for debugging
                                break;
                        case 10 :                                                    // if pin 11 was pressed blink led 7 and write the value to the 2nd MCP23017 chip
                                CLEDArray[7] = 1;                                    
                                mcp2.digitalWrite(7, CLEDArray[7]);
                                Serial.println(CLEDArray[7]);                        // used for debugging
                                delay (1000);
                                CLEDArray[7] = 0;                                    
                                mcp2.digitalWrite(7, CLEDArray[7]);
                                Serial.println(CLEDArray[7]);                        // used for debugging
                                break;                        
                    }
                }                
            }                                                                                  
        }
    }
}


-----------------------------Wiring diagrams:-----------------------------


This section holds the diagrams from my eagle project (one for each console)

Left Console:



Center Console:

1ErIg4X.jpg


Right Console:

1ErIg4X.jpg

-----------------------------PCB diagrams:-----------------------------
This section holds the PCB boards that I'll be etching (hopefully tomorrow) I'll add pics of that process once I've completed it.




Left Board:




Center Board:



Right Board:
 
Last edited:
its works.... so lets upgrade it !!!!!!!!!

Update:


Iv been playing on and off for a while now, I'm not 100% happy with the build... YET!!!!

I'm happy with the functionality and direction of the system but i think now that i have a working product its time to do some refinement!

So I have composed a list of upgrades / revisions that i will be chipping away at:


---------------- To Do List ----------------

1) The current panels and button mounting alignment is less then perfect so I'm in the process of developing vector files so that I can laser cut and etch some acrylic with labels and precision alignment (photos to come)

2) I'll also add back-lighting to the new acrylic panels, like I originally wanted (RGB with hue selection)

3) I'll swap out my current square push buttons for a cleaner looking round flush mount button (pics to come)

4) I had some minor (but very annoying) issues with my home made PCBs so I'll be ordering some PCB(s) based on my design in Eagle CAD : a shield that mounts a pro-micro and 2 MCP23017(s) with daisy chaining capability (for expansion) additionally this will allow me to drop down to using just ONE pro micro (originally 3) (pics to come)

5) Also I'll be adding a few controls for other PC operations (to further avoid using Keyboard or mouse while playing (list of controls to come)
 
Last edited:
On the #4 topic, i suggest you add a reset button and a i2c header for easy reflashing and expandability.

IMG_2327.jpg
i have some surplus pro micro/23017 breakout boards if you PM me i'll send you two spares.

ps i am working on a 2nd version of my PCB to house a custom arduino with 4x 12bit ADC, two 23017’s and a led driver on one pcb. Also will come with a sturdy usb plug and option for panel mounting because my pro micros keep breaking apart from plugging in and out.
 
Last edited:
Thanks for the input, a reset is a good idea.

i just send out the Gerber files to have a new pcb made. its a pro-micro to 2 mcp breakout with power and gnd supply. This board has 2 pin sets that will let a person "daisy chain" multiple together... a dip switch to addresses each of the mcp chips, a reset button and a test button to test chip 1 gpa-0... i should have 20 of these by next week

Sfa6S85.png
 
ahh yes, ill write a more detailed post on the new pcb (with sch and brd files) this evening (lol i'm currently at work writing this from my phone).
 
I like how you made the INT pin mappable with a jumper header, nice detail!

update: i tried to figure out your pcb design, i can't understand the diodes and i can't locate any i2c pullups. I might be missing something...
 
Last edited:
I like how you made the INT pin mappable with a jumper header, nice detail!

update: i tried to figure out your pcb design, i can't understand the diodes and i can't locate any i2c pullups. I might be missing something...


Im cleaning up the wiring diagram and adding detailed notes. I hope this will answer all your questions. also once i post it you guys can give me feed back (possible upgrades for the next revision)

- - - - - Additional Content Posted / Auto Merge - - - - -

Nice "bear claw" silk. heh

Ahhh, customizing, oh the joy.. ;)



lol i figured i would have a few extra and could sell a few, so why not put my "logo" on it ;)
 
quick update : i have cleaned up the schematic for the pcb i posted above


CRFFWMG.png



ALSO i received my other PCB last night that i recently ordered !!!! its a board that holds a single MCP23017 with similar design. its working perfect (I'm using this for a different project lol but i have 20 of them now). I have designed and ordered the Larger board (listed above) as a revision / big brother to this one.


NOTE: the last pic shows the daisy chain effect i was talking about


F7Zl91A.jpg



358w4H8.jpg


usyk1mt.jpg
 
Last edited:
Looking good. Bear.

A small suggestion though. For stability it is advised to use pullup resistors on the i2c bus, and decoupling caps on the VCC next to the 23017s. You could save a diode on the int pins because you can setup the mcps to combine the AB ints internally anyway. As i said earlier, i am working on a very similar setup, nice to see we are having a similar plan. "Great minds think alike"
 
Thanks for the tips!, I'm also working on a larger board with smd LEDs on each i/o for debugging and an additional test button for the 2nd MCP... (but with 15 of these boards on the way I think I'll just make do with them for a while)
 
alright, so one more step down for my "upgrades"... i have just about finished the vector files for the new panels.... (pics to come)
 
pics are here (I rendered with icons for buttons / switches / leds ect... so you guys can better see what it would look like when done / the square icons are buttons are my push buttons)

the colored lines & text will be etched in so the back-lighting will glow there, all other areas will be a solid color. I haven't decided on a black background (pictured) or a silver/grey one (not sure what will look best on the carbon-fiber box).

Each panel will have RGB back lighting (with a hue change rotary encoder on the right panel)

------------Left Panel------------

the "free look" on the left panel will be a thumb stick

the "Launch TS" button will be a hotkey for my pc to launch TeamSpeak (my friends and i prefer to use it)

the sound lvl dial will control my PCs volume output (with a 7 segment display to show lvl)


---------Mid Panel--------------

I think the mid panel is pretty self explanatory

-----------Right Panel-------------

under envo systems there is a dial to set the system to OFF / ON / and AUX (program mode)

the initialize sys will run a startup sequence (kinda like pre flight)

the reset button is just that.. it will rest the sys

the HUE selection is a dial to change the back light color

the back-light lvl will adj the brightness of the back-lighting (with a 7 segment display to show lvl)






Left Panel

6L9zoge.jpg


Mid Panel

qceyYU7.jpg


Right Panel

uJfOVv3.jpg
 
Last edited:
Man that looks awesome.

Constructive comments:
- Landing struts should be 'Landing gear' i think
- Wingman select needs '1','2','3' because E:D does not have a 'select next wingman' button.
-Maybe add a 'system map' button next to the 'galaxy map'.
 
Back
Top Bottom