Jump to content

Is there a way to use an arduino as a macro board?

sam hyslo

I have recently been able to get an arduino nano free from a friend and I was wondering if it was possible, to use the buttons i have, to create a macro board. I understand that it cant do it by default but I was wondering if there was some work around.

The thing was free so if it doesn't work its not too bad.

Hopefully some of you have some advice that I could use.

Link to comment
Share on other sites

Link to post
Share on other sites

What kind of keypad do you have?

With the right matrix you could probably look into the keypad.h library to receive input and then use something like AutoHotkey to capture this input and do something meaningful with.

"We're all in this together, might as well be friends" Tom, Toonami.

 

mini eLiXiVy: my open source 65% mechanical PCB, a build log, PCB anatomy and discussing open source licenses: https://linustechtips.com/topic/1366493-elixivy-a-65-mechanical-keyboard-build-log-pcb-anatomy-and-how-i-open-sourced-this-project/

 

mini_cardboard: a 4% keyboard build log and how keyboards workhttps://linustechtips.com/topic/1328547-mini_cardboard-a-4-keyboard-build-log-and-how-keyboards-work/

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, minibois said:

What kind of keypad do you have?

With the right matrix you could probably look into the keypad.h library to receive input and then use something like AutoHotkey to capture this input and do something meaningful with.

i just have a few buttons are there any good keypads for this?

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, sam hyslo said:

i just have a few buttons are there any good keypads for this?

What kind of buttons? If it's anything like keyswitches, you'll need some more supplies to make it work.

See this post for a how to handwire keyswitches into a keyboard to connect to a microcontroller.

https://geekhack.org/index.php?topic=87689.0

"We're all in this together, might as well be friends" Tom, Toonami.

 

mini eLiXiVy: my open source 65% mechanical PCB, a build log, PCB anatomy and discussing open source licenses: https://linustechtips.com/topic/1366493-elixivy-a-65-mechanical-keyboard-build-log-pcb-anatomy-and-how-i-open-sourced-this-project/

 

mini_cardboard: a 4% keyboard build log and how keyboards workhttps://linustechtips.com/topic/1328547-mini_cardboard-a-4-keyboard-build-log-and-how-keyboards-work/

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, minibois said:

What kind of buttons? If it's anything like keyswitches, you'll need some more supplies to make it work.

See this post for a how to handwire keyswitches into a keyboard to connect to a microcontroller.

https://geekhack.org/index.php?topic=87689.0

https://www.instructables.com/id/Arduino-Nano-Matrix-Keypad-With-Visuino/

I found this guide i was looking for something with this kind of simplicity.

Went on ali express and found this https://www.aliexpress.com/item/32964534104.html?spm=a2g0o.productlist.0.0.647545aet2DC9I&s=p&algo_pvid=2b1d33bd-fa12-4c62-a98e-b70b0c5815cf&algo_expid=2b1d33bd-fa12-4c62-a98e-b70b0c5815cf-0&btsid=eb0ff08a-a4ef-4e71-870d-4f307758860d&ws_ab_test=searchweb0_0,searchweb201602_9,searchweb201603_53

Is it any good?

Link to comment
Share on other sites

Link to post
Share on other sites

5 minutes ago, sam hyslo said:

Sure, just check the keypad has the right cable included for your Arduino.

Reason I linked the guide I did was because you mentioned had buttons, which meant you still had to layout a matrix. A keypad like the one you linked already has that feature enabled.

"We're all in this together, might as well be friends" Tom, Toonami.

 

mini eLiXiVy: my open source 65% mechanical PCB, a build log, PCB anatomy and discussing open source licenses: https://linustechtips.com/topic/1366493-elixivy-a-65-mechanical-keyboard-build-log-pcb-anatomy-and-how-i-open-sourced-this-project/

 

mini_cardboard: a 4% keyboard build log and how keyboards workhttps://linustechtips.com/topic/1328547-mini_cardboard-a-4-keyboard-build-log-and-how-keyboards-work/

Link to comment
Share on other sites

Link to post
Share on other sites

3 minutes ago, minibois said:

Sure, just check the keypad has the right cable included for your Arduino.

Reason I linked the guide I did was because you mentioned had buttons, which meant you still had to layout a matrix. A keypad like the one you linked already has that feature enabled.

do you reckon i could make the outputs the f13 - f24 keys so i can still use the regular keys on my keyboard?

Link to comment
Share on other sites

Link to post
Share on other sites

2 hours ago, sam hyslo said:

do you reckon i could make the outputs the f13 - f24 keys so i can still use the regular keys on my keyboard?

What you're essentially doing here is the equivalent of connecting two keyboards to the computer. It doesn't matter to the OS if the Arduino device is a keyboard or not, as long as the Arduino device pretends to be a keyboard, so there should never be a possibility of conflicts like that, unless you are pushing a key on each device simultaneously.

Normally what a macro key on a keyboard actually does is run a keyboard macro program. At it's simplest, a keyboard macro program is really just a series of keystrokes.

The challenge here, at least from my perspective isn't going to be the physical Arduino device, nor the program that it runs: All it really has to do is enumerate keypresses and send them over the serial connection. The real challenge here is that you will need to build a driver for your Arduino (if you want it to work everywhere in the OS), or possibly a mod or add-on to some specific program if you just want it to work there.

ENCRYPTION IS NOT A CRIME

Link to comment
Share on other sites

Link to post
Share on other sites

It's kind of a pain in the ass to get ATMEGA328p based boards such as the nano to act as HID devices on your computer. This is because they don't have a built in USB transceiver in them and must use a USB to serial converter for them to be programmed over USB (that's that little rectangular chip on the bottom of the board). Now it's not impossible, just a pain in the ass. It's much easier to do this with an Arduino Pro Micro, Zero, or other board that uses the ATMEGA32u4 or ATSAMD21  chips as those have the built in USB transceivers. 

 

HOWEVER, I found this Arduino Library a while ago that claims to enable HID support for 328P equipped boards such as the Arduino Uno and Nano such as you have with some software on your computer. It's not as easy as just plugging in a keyboard or macropad, but you can do it.

ASU

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×