Initial V is a BMW shifter that has been converted to a Bluetooth keyboard.
In this repository, you’ll find schematics and PCB designs, stl files,
a Vim plugin, and client software for turning a BMW
shifter in to a Bluetooth keyboard that can control Vim.
Think of this project as a very over-engineered Vim clutch.
What does it do?
Initial V is a Bluetooth Keyboard specialized for controlling Vim.
The key presses sent depend on Vim’s state.
The table below describes the key presses for each handle position according to the state of the editor:
Park | Up | Down | Double Up | Double Down | Move Left | Left Up | Left Down | Move Right (back to center) | |
---|---|---|---|---|---|---|---|---|---|
Normal Mode (Drive) | :w on a modified buffer, :wq on unmodified buffer |
Up key | Down key | i |
o |
CTRL-V |
Up Key | Down key | ESC |
Insert Mode (Neutral) | ESC |
Up key | Down key | Page Up | Page Down |
“Drive” on the handle means “Normal Mode” in Vim. “Neutral” on the handle means “Insert Mode” in Vim.
It’s not possible to move the handle to the left when the handle is in Neutral mode, so there are no key combinations.
I’m not sure what mode in Vim would map to Reverse on the handle, so there’s no way to transition to Reverse at the moment.
Saving a buffer in Normal mode will put the handle in to the “Park” position.
The Park position behaves the same way as Drive (Normal mode in Vim) except that if you hit Park again, it will exit Vim.
Hardware Design
The BMW handle communicates via CAN bus.
The PCB uses an ESP-MINI-1 chip with Bluetooth capabilities, and an SN65HVD230D for CAN bus communication.
The handle runs on 12v, so I used a MPM3610GQV buck converter to step the voltage down to 3.3v for the ESP.
I must give a huge thanks to @projectgus for decoding the CAN bus data.
This project would not be possible without their hard work.
Software Design
The handle appears as a Bluetooth keyboard to the operating system, but it in order to change the handle state we require a way to communicate data back to the