1

I want to make a keyboard type panel, which will only have 7 buttons and two knobs, and connect it arduino to program it with functions, he heard that he needed the Keyboard library. but it is not available with arduino uno, which is what I work with, he heard about what I should do a keyboard mapping, it would help me explain to lay a foundation and carry out the project that I want "please do not leave me with the doubt". first of all, Thanks.

2
  • it is unclear what is your question
    – jsotola
    Commented Oct 29, 2019 at 16:09
  • The Uno can't (easily) do keyboard functionality. Get a Leonardo or Micro instead.
    – Majenko
    Commented Oct 29, 2019 at 16:21

1 Answer 1

1

If you plan to trigger function on a PC by keystroke and want to simulate a PC keyboard on the PC with your computer than I recommend to use the keyboard lib which is able to map your button to key codes and send them to a PC over USB. But the communication over USB and the simulation of a HID (Human Interface Device) connection is (as far as I know) not possible with an Arduino. (You need a 32u4 or SAMD micro based board) like the leonardo.

But if you just plan to trigger functions, that run on the Arduino, the kb lib is not necessary. That a standard job for the Arduino and can be done with 7 input pins and 2 analog pins.

9
  • It is actually a game of reactions, the game appears on the computer and the subject reacts from the panel, if possible? I don't know how to do it, they tell me, that I should do a keyboard mapping that I want to implement, but I don't have a micro or leonardo, what can I do? Commented Oct 29, 2019 at 16:56
  • is that it is my project to pass intern of my studies Commented Oct 29, 2019 at 19:25
  • I'm very busy this morning, but this evening I try to find a solution. In the meanwhile, there is a software called processing ( processing.org ), that can interact with arduinos of all kind. It something like the Arduino IDE and must also be programmed in a C/C++ dialect. Perhaps you find some ideas, if you look at the example projects. Can you control the game with serial input, I mean, have you access to the games code, and can write your own controlling interface? If not, you have to simulate keyboard events. Commented Oct 30, 2019 at 9:11
  • the game is made in java, I will add the hardware part and good If you have any ideas, I would appreciate it !! and thanks I will look at the page you recommended. thanks for answering i'm stressed Commented Oct 30, 2019 at 15:09
  • If I understand you right, you build the hardware (the control panel) and some others write the game in Java. If they are nice guys, you and your colleagues could create a text based control protocol and you use this protocol to send control statements to the game over the serial interface. That's easy for you and the game writers too. And it is the only easy way a UNO can communicate with a PC. In the arduino you only need Serial.print("control statement")` commands; An in Java thei can use a serial communication lib like fazecast.github.io/jSerialComm Commented Oct 30, 2019 at 21:18

Not the answer you're looking for? Browse other questions tagged or ask your own question.