I am looking for a combination of these… like if i press on dome button that should be mapped to a particular key in keyboard. (say Enter or a space bar). I am not an electronics person, so excuse my ignorance and any guidance is much appreciated.
Depending on what you are interfacing with i see a few options and I would expect some gadget somewhere may already be made to do each option.
Option1.
Have a controller that can act like a usb keyboard (e.g. ESP32-S2 or S3) then connect each button to a GPIO for input. On buttion press, send keyboard code to computer.
This option, if generic enough should be transparent to everything that accepts a USB-HID-Keyboard at the expense of setting up a device and map GPIO to USB Keystrokes.
Option 2
Have some middle-ware device get the button presses (like above) but send to an API/Service on the target OS.
The allows transparent device, at the expense of needed specific “drivers” for your os.
Option1 Seems like a simple option to me.
e.g. I just got an ESP32-S3, used the example tusb-hid code, compile flashed and it sent the letter ‘a’ to my computer as a keyboard input and then made my mouse move in a square.
Following on from what Michael mentioned, we have this guide on our website that should get you started, you would be looking to replace the push buttons with the big button.
Thanks for your response.
I want to connect that button to a android tablet through USB or bluetooth.
It will always be space bar or enter button what even we program it for first time.
The purpose of this is, user will tap on button to report when cycle completed.
Then i want to store the time taken for him to complete one cycle.
That logic i can write in my app, but i want a mechanism to capture that tap on that button.
I had a bit of a look around and there’s this library I found for ESP32 that allows you to program it to be a Bluetooth keyboard.
It’s pretty decently documented and the example code shows it’s possibilities.
It should be decently easy to wire up a button and write a program that will do what you need it to.
This will work great @Murali273296 if you’re in a language like Kotlin reading bluetooth keyboards is easy through the devices API.
Does this have to work with ANY tablet, (e.g. samsung, google, etc) that could be running ANY version of android? Do you have full control over which device is used and if so is it the same device every time?
Are you able to tell us a bit more about your project? From this peek inside, another input type might be more suited, what task is the user completing?
Does it have to be sent to a tablet? If you are using a microcontroller you can use that to time the tasks and much more, it doesnt end at keypresses.
If you’re keen on a dive into Maker Electronics and other neat project related stuff I’d recommend checking out these:
Not sure if your project was still ongoing, if its not here’s a link to my GitHub repo where I’ve used one of our makerverse keyboards and a pi pico to make a macropad. I’m certain that you could use this as a basis to make your project work.