Programming a Morse Code straight key

Hello! I've got a simple question that probably has a simple answer. I am BRAND spanking new to Arduino, I barely know what I'm doing, but I know how to copy and paste code and I can make circuits.

I'm trying to make a simple morse code key, and I know there are other topics on this but I'm trying to do something SUPER simple - I'm going to build and wire like a regular morse straight key (when you press the lever it makes contact with a plate, completing the circuit), but all I need to do is make that contact be a left click on my PC (or the [ or ] key).

Does that make sense? So how would I go about this? I'm fine just using the Arduino's computer connector cable to use it.

Thanks!!

No, not really. You want to click a mouse connected to a Pc and somehow an Arduino is involved.

Make schematics and post them.

When the contact on key is made, I want it to left click on my PC. Can I somehow tell Arduino like, "act like a mouse"
?? work with me here :rofl:

Can You just use a button or smilar connected to the Arduino?

https://www.arduino.cc/reference/en/language/functions/usb/mouse/

Thanks! I'll take a look

Mind you, it makes no sense. :grimacing:

Buy $5 mouse. Unscrew it. Connect Morse key to left button. :sunglasses:

Wait - projects have to make sense? :expressionless:

a7

Only certain Arduinos can send keypresses to the PC. Leonardo, Pro Micro and some others... Uno and Mega can't do it.

1 Like

Look at the Arduino File/Examples/USB/KeyboardAndMouseControl example and see if it does what you need. (only works on Arduinos with a built-in USB)

Also some big assumptions here, may be blocking you. You could send keypress events to a PC app interfacing the Arduino serial port instance, using any Arduino, since they all support serial protocol. You don't have to use mouse or keyboard input.

I'm doing this for Mark Rober engineering assignment, I have to use an Arduino

Also I already built one with a mouse lol

Darn! I'm UNO.

Thanks!

Once upon a time using IDE 1.01:

String numeric output with V-USB HID - Community / Exhibition / Gallery - Arduino Forum

Have not played with V-USB in years and not since IDE 1.5x

There's this: How to use 'Mouse.begin()' for ArduinoUNO? - #8 by system

Well, actually, they can. :+1:

Specifically, a real UNO or "Mega", not a fake one which has a CH340 chip instead of the 16U2 interface as the 16U2 can be re-programmed as a HID using procedure whose name eludes me at present.

Doh'- I've been doing it wrong all these years.

True, but maybe not the best way if you are, "BRAND spanking new to Arduino, I barely know what I'm doing".

I have a knockoff, ELEGOO I believe