i want my keyboard matrix to be wireless.

I have a keyboard matrix soldered to a pro micro, right now. It uses a usb connector but I would like it to be wireless. The usb cord bothers me, i want more freedom of movement.

I have the code working for the keyboard matrix but I would like someone to add wireless functionality. I have bluetooth and esp8266. I have 2 hc05 slave/master already paired, that parts done. I own 2 pro micros, I thought I would use.

So, I was thinking the keyboard matrix would be soldered to a pro micro, that pro micro would also have a 5v Bluetooth receiver soldered on (i checked the pins, it should work), that bluetooth reciever would communicate to a second Bluetooth receiver, that second Bluetooth receiver is plugged into a second pro micro, that second pro micro would then be plugged into a computer, if it could show up as an, 'HID' instead of a pro micro device in device manager, that would be wonderful.

I don't know how to write the code for the hc05 serial communication. I am pretty certain I would need 2 sets of code, 1 set of code for each pro micro. I don't know what a fair price on writing this code would be. I don't want to insult anyone, on a subject I have no idea how to estimate. Quotes would be appreciated.

I also have 2 esp8266 devices, if that in any way would be better. I just assume Bluetooth would be.

I hope I explained that all okay. I would be glad to answer any questions.

AFAIK only the Arduino Yun can show up as HID, no other Arduinos.

HC-05 can be treated as a wireless Serial connection.

Once paired HC-05 will just transmit the information they get to the other side.

So the Arduino connected to the keypad (keyboard matrix) can be a simple arduino running a dumbed down code, with the master HC-05 attached (after uploading the code) to pin 0 and 1 (Serial)

#include <Keypad.h>

const byte ROWS = 4; 
const byte COLS = 3; 
const char keys[ROWS][COLS] = {
  {'1','2','3'},
  {'4','5','6'},
  {'7','8','9'},
  {'*','0','#'}
};

const byte rowPins[ROWS] = {5, 4, 3, 2}; //connect to the row pinouts of the keypad
const byte colPins[COLS] = {8, 7, 6};    //connect to the column pinouts of the keypad

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

void setup(){
  Serial.begin(38400); // whatever baud rate is used for talking to your HC-05
}
  
void loop(){
  char key = keypad.getKey();
  
  if (key != NO_KEY){
    Serial.println(key);
  }
}

then on the other side you need two Serial lines, one for the slave HC-05 and one that will be used to connect the USB cable so that you appear as a HID device (keyboard) to your host computer.

This only works with certain Arduinos (32u4 or SAMD micro based boards) and the keyboard library enables to send keystrokes to an attached computer through their micro’s native USB port.

if you use a pro-micro then you have only one Serial port, so you will need to use Software Serial.

something as simple as this would probably work:

#include <SoftwareSerial.h>
SoftwareSerial HC05Serial(2, 3); // RX | TX --> connect to pin 2 and 3
const byte securityPin = 4; // to activate the keyboard function, pin 4 needs to be connected to GND

void setup()
{
  pinMode(securityPin, INPUT_PULLUP);
  Keyboard.begin();
  HC05Serial.begin(38400);  // whatever baud rate you configured don't go too fast
}

void loop()
{
  int r = HC05Serial.read();
  if (r != -1) { // -1 means nothing received
    if (r >= '0' && r <= '9') || r == '*' || r == '#') { // is it really a correct character
      if (digitalRead(securityPin) == LOW) Keyboard.write((char) r); // to be on the safe side
    }
  }
}

Note that the keyboard documentation mentions to be careful

A word of caution on using the Mouse and Keyboard libraries: if the Mouse or Keyboard library is constantly running, it will be difficult to program your board. Functions such as Mouse.move() and Keyboard.print() will move your cursor or send keystrokes to a connected computer and should only be called when you are ready to handle them. It is recommended to use a control system to turn this functionality on, like a physical switch or only responding to specific input you can control. Refer to the Mouse and Keyboard examples for some ways to handle this.

--> that's why I'm adding a test on pin #4 to see if it's connected to ground. for this to work you need that wire / switch installed. if somethings goes weird, disconnect from ground and no input will be sent to your PC.

There are tons of documentation on how to configure two HC-05 to work as a master and slave devices, so make sure they are paired before connecting them to both Arduinos.

(all code typed here an totally untested :slight_smile: - see that as a conceptual approach to your need)