Button matrix

For the past weekends I started thinking about how to implement the FMS.

Collins PL21 FMS

Collins PL21 FMS

There are two things to solve:

  1. MilViz its KA350i does not provide any external interface with the FMS. The only thing that is there is the FMS panel as part of the VC, and the FMS as 2D panel.
  2. The PL21 FMS has about 67 buttons in a very small enclosure, which all need to work flawlessly to have a nice user experience.

The first topic I’ll discuss later on, but the current idea is to have a ‘Robot mouse’ that executes move and click actions within the 2D panels. The second topic will be resolved by creating a 7×10 tactile button matrix using Arduino. Each button will be assigned an identifier that is recognized by the ‘Robot mouse’, which will in turn perform the related action(s).

The implementation in arduino:

/*
   Assign to each button within a matrix of buttons a unique character.
   When a button is pressed, the character is sent to the serial port.
      
   On the receiving end a Windows application will read the values and the appropriate actions will be taken.
   e.g. Pressing the button identified by 'A' will result in 'A' being pressed on the CDU in P3D.
   
   The circuit: matrix of tactile buttons.

   Note: Currently, only a 3x3 matrix was created, so 
   - only 6 pinouts are actually read
   - only 9 values can be communicated

   Created 2017/06/18
   By Maarten Van Damme
   Modified
   By Maarten Van Damme

   http://projects.familievandamme.be

   Based on sample: http://playground.arduino.cc/Code/Keypad

*/
#include <Keypad.h>

const byte ROWS = 7; //four rows
const byte COLS = 10; //three columns
char keys[ROWS][COLS] = {
  { '#','$','%','&','(',')','*',',','-',':'},
  { ';','<','=','>','?','@','[',']','^','a'},
  { '{','}','~','"','\'','!',' ','|','b','c'},
  { '1','2','3','A','B','C','D','E','F','G'},
  { '4','5','6','H','I','J','K','L','M','N'},
  { '7','8','9','O','P','Q','R','S','T','U'},
  { '.','0','+','V','W','X','Y','Z','_','/'}
};

byte rowPins[ROWS] = {13,12,11}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {5, 4, 3}; //connect to the column pinouts of the keypad

Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );

void setup(){
  Serial.begin(9600);
}

void loop(){
  char key = keypad.getKey();

  if (key != NO_KEY){
    //Just send the key value. The library will add two characters: "\r\n"
    Serial.println(key);
  }
}

The test panel (only implementing a 3×3 matrix):

The running code I’ll show in a video later on.

Leave a Reply

Your email address will not be published. Required fields are marked *