vail-adapter/README.md

194 lines
6.1 KiB
Markdown
Raw Normal View History

---
Author: neale
Email: neale@woozle.org
License: MIT
---
2020-05-16 10:43:38 -06:00
# Project: USB Morse Adapter
2020-05-16 10:43:38 -06:00
![Vail adapter, assembled and connected](https://lh3.googleusercontent.com/pw/ACtC-3d9xbLxL23QeLm-3gy3-Yt0VHE3IlQ-qyMDqTfdF6Bo7fHkkokACdIs68pmXevu14VzrrCeKj1JmRUiekUNiZe9J9rYIh_pTagvCbKSzpY8Ynp1m6cF4G_jTvtiU5eRtoNCsmU5OLy2SR9kYcCDYSt-AA=s1471-no)
2020-05-17 13:24:58 -06:00
2020-05-16 10:43:38 -06:00
This translates Morse key inputs into USB events,
either MIDI or MIDI+Keyboard,
so you can use a computer.
It is fully compatible with [VBand](https://hamradio.solutions/vband/)
and anything else that uses the VBand adapter.
2020-05-16 10:43:38 -06:00
I use this with an Internet morse code repeater I wrote,
available at https://vail.woozle.org/.
This project requires an Arduino that can send USB.
2021-01-18 15:21:08 -07:00
The following should work:
2020-05-16 10:43:38 -06:00
### Verified Working
2021-01-18 15:21:08 -07:00
* Seeeduino Xiao **(recommended)**
2021-01-18 15:21:08 -07:00
* Arduino Micro
* KeeYees Pro Micro
### Unverified but should work
2021-01-18 15:21:08 -07:00
Any USB-capable Arduino should be fine, including:
* Arduino Leonardo
* Arduino Zero
* Adafruit Trinket M0
* Adafruit GEMMA M0
* Adafruit Feather M0
2021-04-26 08:45:41 -06:00
It may also be possible to get this working on a DigiSpark.
I'm trying to convince Michele Giugliano to try :)
=== Similar projects
* Vail user Michele Giugliano's [MorsePaddle2USB](https://github.com/mgiugliano/MorsePaddle2USB),
which runs on a DigiSpark (attiny85). It only sends keystrokes, so you must keep the Vail
window focused: you can't switch to other apps and still transimit.
* Ham Radio Solutions sells a [USB Paddle Interface](https://hamradio.solutions/vband/)
which appears to be very similar to Michele's project. You must keep the Vail window focused.
2020-05-16 10:43:38 -06:00
## Step 1: Installation
2020-05-16 10:43:38 -06:00
#### The Easy Way
2020-05-16 10:43:38 -06:00
I plan to begin releasing precompiled images for the Seeeduino XIAO.
You should be able to
[enter bootloader mode](https://wiki.seeedstudio.com/Seeeduino-XIAO/#enter-bootloader-mode)
and just drag the `.uf2` file onto the new drive it provides,
then you're done.
#### The Other Way
2020-05-16 10:43:38 -06:00
Install the MidiUSB and Keyboard libraries.
These are highly popular libraries,
and there is much better documentation elsewhere on the Internet.
The code should then build in the Arduino IDE.
2020-05-16 10:43:38 -06:00
## Step 2: Assmble the circuit
2020-05-17 13:08:59 -06:00
### For the impatient:
2020-05-17 13:08:59 -06:00
[Photos of assembled circuit](https://github.com/nealey/vail-adapter/wiki)
2020-05-17 13:08:59 -06:00
### For the inquisitive:
2020-05-17 13:08:59 -06:00
2020-05-16 10:43:38 -06:00
Morse code keyers are very simple devices,
they just connect two wires together.
You could use a button if you wanted to,
or even touch wires together.
The only real complication here is that some browsers
need to get keyboard events instead of musical instrument events.
The Vail adapter boots into a mode that sends both keyboard events
and MIDI messages.
If it receives a MIDI key release event
on channel 0
for note C0,
it will disable keyboard events.
2020-05-16 10:43:38 -06:00
Vail sends this "disable keyboard" MIDI event, so as soon as you
load up Vail, the keyboard events are disabled, and your adapter
will no longer interfere with your typing.
If your browser doesn't support MIDI,
the disable command can't be sent,
and it keeps on sending keystrokes.
2020-05-16 10:43:38 -06:00
### Wire up your input device
2020-05-16 10:43:38 -06:00
Hook a straight key into ground on one side,
pin 10 on the other.
It's okay to leave pin 10 disconnected if you don't have a straight key.
Hook an iambic paddle in ground in the middle,
pins 11 and 12 on the outside posts.
It's okay to leave pins 11 and 12 disconnected if you don't have a paddle.
=== Using a headphone jack
If you prefer, you can wire a headphone jack up to GND, 11, and 12.
GND should be the sleeve, 11 the ring, and 12 the tip.
o --- 12
|_| --- 11
| | --- GND
| |
2020-05-16 10:43:38 -06:00
Make sure any straight key you plug in has a TS adapter (mono plug):
this will short pin 11 to ground and signal to the Arduino to
go into straight key mode.
If you change from an iambic key to a straight key,
you'll have to reset the adapter by unplugging it from the computer.
2020-05-16 10:43:38 -06:00
## Step 3: Load the code
2020-05-16 10:43:38 -06:00
Upload the code contained in this sketch on to your board.
## Step 4: Test it out
2020-05-16 10:43:38 -06:00
Make sure it's plugged in to your computer's USB port.
If you connected pin 9 to ground,
Open anything where you can type,
type in "hello", and hit the straight key.
You should see a comma after your hello.
Now you can open https://vail.woozle.org/,
click the "KEY" button once to let the browser know it's okay to make sound,
and you should be able to wail away on your new USB keyer.
## Step 5: Debugging
If you plug in your straight key and it looks like DAH is being held down,
it means you need to switch the connections to pins 11 and 12.
If you plug in your straight key and it looks like DIT is being held down,
it means you need to reset the Arduino to make it detect the key type again.
2020-05-16 10:43:38 -06:00
# License
2020-05-16 10:43:38 -06:00
This project is released under an MIT License.
Copyright © 2020 Neale Pickett
Copyright © 2013 thomasfredericks
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
The software is provided "as is", without warranty of any kind, express or
implied, including but not limited to the warranties of merchantability, fitness
for a particular purpose, and noninfringement. In no event shall the authors or
copyright holders be liable for any claim, damages, or other liability, whether
in an action of contract, tort or otherwise, arising from, out of, or in
connection with the software or the use or other dealings in the software.
# Contributing
2020-05-16 10:43:38 -06:00
To contribute to this project please contact neale@woozle.org
https://id.arduino.cc/neale
# BOM
2020-05-16 10:43:38 -06:00
In addition to a key, some hookup wires, and a USB cable,
2021-01-18 15:21:08 -07:00
you only need a USB-capable Arduino: see above.
Since I don't know what might try to parse this section,
I'm calling for an Arduino Micro. But, really, many options
will work fine.
2020-05-16 10:43:38 -06:00
| ID | Part name | Part number | Quantity |
| --- | ------- | ------ | ------ |
| A1 | Seeeduino XIAO | 102010328 | 1 |