theuser42Prankster517
Published © LGPL

Gaming Keypad Using Thrilles

ArcheAge gamepad for instant combos.

BeginnerWork in progress3 hours7,680
Gaming Keypad Using Thrilles

Things used in this project

Hardware components

Arduino Leonardo
Arduino Leonardo
×1
Adafruit Thrilles keypad
×1
Jumper wires (generic)
Jumper wires (generic)
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)
3D Printer (generic)
3D Printer (generic)

Story

Read more

Custom parts and enclosures

3D files

Schematics

Threllis build

Wire the Threllis

Code

The Code... UPDATED (5/5/2018)

Arduino
Code is still in the works....
/*
 * 	
 * Prankster517Code for Gaming Keyboard
 * Date: 3-20-2018
 * Made by: theuser42
 * Hardware: Trellis, Arduino Leonarto, and LED[16]
 * Wiring: Connect Trellis Vin to 5V and Ground to ground.
 *         Connect the INT wire to pin #A2 (can change later!)
 *         Connect I2C SDA pin to your Arduino SDA line
 *         Connect I2C SCL pin to your Arduino SCL line
 *         
 *         KEY PAD LAYOUT [16]
 ***************************************       
 *         | 3 | 7 | 11 | 15 |
 *         | 2 | 6 | 10 | 14 |
 *         | 1 | 5 |  9 | 13 |
 *         | 0 | 4 |  8 | 12 |
 ***************************************         
 *         Hex Chart
 ***************************************         
 * # 0x hex
 * 0  -  00
 * 1  -  01     
 * 2  -  02    
 * 3  -  03    
 * 4  -  04    
 * 5  -  05    
 * 6  -  06    
 * 7  -  07    
 * 8  -  08    
 * 9  -  09    
 * shift - 81        
 * ctrl - 80
 * 
 *         
 */



#include <Wire.h>
#include "Adafruit_Trellis.h"
#include "Keyboard.h"

Adafruit_Trellis matrix0 = Adafruit_Trellis();
Adafruit_TrellisSet trellis =  Adafruit_TrellisSet(&matrix0);
#define NUMTRELLIS 1
#define numKeys (NUMTRELLIS * 16)

// Connect Trellis Vin to 5V and Ground to ground.
// Connect the INT wire to pin #A2 (can change later!)
#define INTPIN A2
// Connect I2C SDA pin to your Arduino SDA line
// Connect I2C SCL pin to your Arduino SCL line
// All Trellises share the SDA, SCL and INT pin! 
// Even 8 tiles use only 3 wires max


void setup() {
   // INT pin requires a pullup
  pinMode(INTPIN, INPUT_PULLUP);
  digitalWrite(INTPIN, HIGH);
  trellis.begin(0x70);
  //     *   *
  //        
  //   *       *
  //     * * *
  trellis.setLED(7);
  trellis.setLED(11);
  trellis.setLED(1);
  trellis.setLED(4);
  trellis.setLED(8);
  trellis.setLED(13);
  trellis.writeDisplay();
  delay(2000);
  trellis.clrLED(7);
  trellis.clrLED(11);
  trellis.clrLED(1);
  trellis.clrLED(4);
  trellis.clrLED(8);
  trellis.clrLED(13);
  trellis.writeDisplay();
  delay(60);

  
  
}

void loop() {
  delay(30); // 30ms delay is required, dont remove me!

  if (trellis.readSwitches()){
       if (trellis.justPressed(0)) {
            // all presses will be in hex value of the keys. 
           Keyboard.begin();
           Keyboard.press(0x00);
           delay(20);
           Keyboard.release();
           Keyboard.end();  
           trellis.setLED(0);
           delay(20980); //1sec delay 
           trellis.clrLED(0):
           
      }
       if (trellis.justPressed(1)) {
           // all presses will be in hex value of the keys. 
           Keyboard.begin();
           Keyboard.press(0x43);
           Keyboard.press(0x04);
           Keyboard.press(0x03);
           delay(20);
           Keyboard.releaseAll();
           Keyboard.end();  
           trellis.setLED(1);
           delay(1000); //1sec delay 
           trellis.clrLED(1):
      }
       if (trellis.justPressed(2)) {
          // all presses will be in hex value of the keys. 
           Keyboard.begin();
           Keyboard.press(0x07);
           Keyboard.press(0x4E);
           Keyboard.press(0x3D);
           delay(20);
           Keyboard.releaseAll();
           Keyboard.end();  
           trellis.setLED(2);
           delay(1000); //1sec delay 
           trellis.clrLED(2):
      }
       if (trellis.justPressed(3)) {
          // all presses will be in hex value of the keys. 
           Keyboard.begin();
           Keyboard.press(0x01);
           Keyboard.press(0x02);
           delay(20);
           Keyboard.releaseAll();
           Keyboard.end();  
           trellis.setLED(3);
           delay(1000); //1sec delay 
           trellis.clrLED(3):
      }
       if (trellis.justPressed(4)) {
           // all presses will be in hex value of the keys. 
           Keyboard.begin();
           Keyboard.press(0x06);
           Keyboard.press(0x04);
           delay(20);
           Keyboard.releaseAll();
           Keyboard.end();   
           trellis.setLED(4);
           delay(1000); //1sec delay 
           trellis.clrLED(4):
      }
       if (trellis.justPressed(5)) {
           // all presses will be in hex value of the keys. 
           Keyboard.begin();
           Keyboard.press(0x01);
           Keyboard.press(0x05);
           Keyboard.press(0x3D);
           delay(20);
           Keyboard.releaseAll();
           Keyboard.end();   
           trellis.setLED(5);
           delay(1000); //1sec delay 
           trellis.clrLED(5):
      }
       if (trellis.justPressed(6)) {
           // all presses will be in hex value of the keys. 
           Keyboard.begin();
           Keyboard.press(0x42);
           Keyboard.press(0x4E);
           delay(20);
           Keyboard.releaseAll();
           Keyboard.end();   
           trellis.setLED(6);
           delay(1000); //1sec delay 
           trellis.clrLED(6):
      }
       if (trellis.justPressed(7)) {
           // all presses will be in hex value of the keys. 
           Keyboard.begin();
           Keyboard.press(0x08);
           Keyboard.press(0x04);
           Keyboard.press(0x02);
           delay(20);
           Keyboard.releaseAll();
           Keyboard.end();   
           trellis.setLED(7);
           delay(1000); //1sec delay 
           trellis.clrLED(7):
      }
       if (trellis.justPressed(8)) {
          // all presses will be in hex value of the keys. 
           Keyboard.begin();
           Keyboard.press(0x02);
           Keyboard.press(0x05);
           Keyboard.press(0x3D);
           delay(20);
           Keyboard.releaseAll();
           Keyboard.end();   
           trellis.setLED(8);
           delay(1000); //1sec delay 
           trellis.clrLED(8):
      }
       if (trellis.justPressed(9)) {
          // all presses will be in hex value of the keys. 
           Keyboard.begin();
           Keyboard.press(0x09);
           Keyboard.press(0x54);
           delay(20);
           Keyboard.releaseAll();
           Keyboard.end();   
           trellis.setLED(9);
           delay(1000); //1sec delay 
           trellis.clrLED(9):
      }
       if (trellis.justPressed(10)) {
           // all presses will be in hex value of the keys. 
           Keyboard.begin();
           Keyboard.press(0x56);
           delay(20)
           Keyboard.release();
           Keyboard.end();  
           trellis.setLED(10);
           delay(1000); //1sec delay 
           trellis.clrLED(10):
      }
       if (trellis.justPressed(11)) {
           // all presses will be in hex value of the keys. 
           Keyboard.begin();
           Keyboard.press(0x6D);
           delay(20);
           Keyboard.release(); 
           Keyboard.end();  
           trellis.setLED(11);
           delay(1000); //1sec delay 
           trellis.clrLED(11):
      }
       if (trellis.justPressed(12)) {
           // all presses will be in hex value of the keys. 
           Keyboard.begin();
           Keyboard.press(0x81);
           Keyboard.press(0x00);
           delay(20);
           Keyboard.releaseAll();
           Keyboard.end();   
           trellis.setLED(12);
           delay(1000); //1sec delay 
           trellis.clrLED(12):
      }
       if (trellis.justPressed(13)) {
           // all presses will be in hex value of the keys. 
           Keyboard.begin();
           Keyboard.press(0x01);
           delay(20);
           Keyboard.release(); 
           Keyboard.press(0x01);
           delay(20);
           Keyboard.release(); 
           Keyboard.press(0x01);
           delay(20); 
           Keyboard.release(); 
           Keyboard.press(0x01);
           delay(20);
           Keyboard.release(); 
           Keyboard.end();  
           trellis.setLED(13);
           delay(1000); //1sec delay 
           trellis.clrLED(13):
      }
       if (trellis.justPressed(14)) {
           // all presses will be in hex value of the keys. 
          Keyboard.begin();
          Keyboard.press(0x00);
           delay(20);
           Keyboard.release(); 
           Keyboard.press(0x00);
           delay(20);
           Keyboard.release(); 
           Keyboard.press(0x00);
           delay(20); 
           Keyboard.release(); 
           Keyboard.press(0x00);
           delay(20);
           Keyboard.release(); 
           Keyboard.end();  
           trellis.setLED(14);
           delay(1000); //1sec delay 
           trellis.clrLED(14):
      }
       if (trellis.justPressed(15)) {
           // all presses will be in hex value of the keys. 
          Keyboard.begin();
          Keyboard.press(0x6D);
           delay(20);
           Keyboard.release(); 
           Keyboard.press(0x6D);
           delay(20);
           Keyboard.release(); 
           Keyboard.press(0x6D);
           delay(20); 
           Keyboard.release(); 
           Keyboard.press(0x6D);
           delay(20);
           Keyboard.release();
           Keyboard.end();  
           trellis.setLED(15);
           delay(1000); //1sec delay 
           trellis.clrLED(15):
           
      }
        trellis.writeDisplay();
    }
  }

Credits

theuser42

theuser42

5 projects • 5 followers
I have been making for sometime now in the software world with Visual Basic 6.0/.NET. Hardware control is what i found a passion.
Prankster517

Prankster517

0 projects • 2 followers

Comments