• Stars
    star
    959
  • Rank 45,746 (Top 1.0 %)
  • Language
    C++
  • License
    Apache License 2.0
  • Created about 1 year ago
  • Updated 7 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

It's a BMW shifter converted to a Bluetooth Keyboard that you use with Vim

Initial V

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.

Handle Front View Handle Side View

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 handle. I used HID data APIs to send bytes back to the handle, requesting the handle to change state. There is a client written in Zig here, and also a Ruby client here. Finally, I wrote a Vim plugin that sends commands to the handle whenever Vim changes modes. This means that the handle will maintain state along with Vim's state even if the user changes state via keyboard (like hitting i on their keyboard, etc).

The general flow is (from Normal mode):

  1. Double shift the handle up to send i
  2. Vim goes in to insert mode which triggers the Inivial V Vim plugin
  3. The Vim plugin requests the handle change state
  4. The handle changes state

End

I had a ton of fun building this project. I will update each directory with a README for more detailed build instructions. I'm also going to make a promotional video as well, but I felt I needed to fill out the README since the project is public at this point anyway!!

More Repositories

1

asmrepl

A REPL for x86-64 assembly language
Ruby
867
star
2

rails_autolink

The auto_link function from Rails
Ruby
582
star
3

the_metal

A spike for thoughts about Rack 2.0
Ruby
519
star
4

analog-terminal-bell

A bell for your terminal that is analog
OpenSCAD
474
star
5

tenderjit

JIT for Ruby that is written in Ruby
Ruby
416
star
6

fisk

A pure Ruby assembler
Ruby
295
star
7

phuby

phuby wraps PHP in a loving embrace
Ruby
266
star
8

hana

An implementation of JSON Patch and JSON Pointer for Ruby
Ruby
214
star
9

esp8266aq

ESP8266 and Plantower AQ sensor
C++
212
star
10

recma

Pure ruby javascript parser and interpreter.
Ruby
194
star
11

dnssd

Multicast DNS client for ruby! YAY!
Ruby
173
star
12

ruby-glossary

Just a glossary of terms I've found in Ruby source code
172
star
13

enterprise

Make ruby ruby application enter the enterprise with the enterprise gem
Ruby
156
star
14

heap-analyzer

A heap analyzer for MRI that isn't very good.
JavaScript
141
star
15

rexical

rexical is a lexical scanner generator for ruby
Ruby
135
star
16

namecase

Properly case people's names
Ruby
128
star
17

refreshing

A Rails Engine that gives Language Server support to Rails apps
Ruby
112
star
18

tusk

Message busses with Observable API
Ruby
101
star
19

uart

Simple serial / UART interface for Ruby
Ruby
100
star
20

heapfrag

Heap visualizer for Ruby
Ruby
97
star
21

nfc

NFC is a ruby wrapper for the Near Field Communication library.
C
90
star
22

rubycommitters.org

The source for rubycommitters.org
Ruby
83
star
23

ds9

Wrapper around nghttp2
C
80
star
24

tinygql

A tiny and experimental GraphQL parser in Ruby
Ruby
78
star
25

fibur

Concurrent execution during Ruby I/O
Ruby
78
star
26

our_pc

Our Procedure Calls
Ruby
71
star
27

magic_scan

My magic card recognition system
Ruby
69
star
28

av_capture

A wrapper around av_capture on OS X
Objective-C
68
star
29

aarch64

Pure Ruby ARM64 Assembler
Ruby
64
star
30

gda

A SQL parser. It wraps libgda
C
64
star
31

taka

Taka is a DOM (core and html) implementation for Ruby
Ruby
63
star
32

minitest-emoji

View your test output as emoji
Ruby
59
star
33

mmap

A wrapper around mmap
C
57
star
34

neversaydie

NeverSayDie will let you rescue from SEGV's and is evil
Ruby
55
star
35

reloader

A demo of live streams on Rails 4
Ruby
50
star
36

HTML5DeckBuilder

an html5 mtg deck builder
JavaScript
49
star
37

sphero

A ruby gem for the sphero ball
Ruby
45
star
38

dot_vim

my dot vim directory
Vim Script
44
star
39

markup_validity

Test for valid markup with test/unit or rspec
Ruby
44
star
40

my_thing

demo of regression test selection
Ruby
42
star
41

defrost

Never let pesky "frozen" objects get in your way again! Use Defrost to remove the frozen state from your objects!
Ruby
41
star
42

gem_survey

a survey script for gems
Ruby
41
star
43

spectacular

View SNMP in your browser
Ruby
38
star
44

zeroconf

Multicast DNS client and server written in pure Ruby
Ruby
30
star
45

leap_motion

Ruby bindings to the Leap Motion C++ library
C++
30
star
46

paddle

Paddle is an rdoc plugin for emitting epub books suitable for use with iBooks
Ruby
29
star
47

horo

RDoc style extracted from Rails and refactored for RDoc 2.5.x
Ruby
26
star
48

earworm

What is that song? Earworm uses libofa and MusicDNS to tell you.
Ruby
26
star
49

streamdeck-ruby-plugin

Minimal Stream Deck plugin written in Ruby
Ruby
24
star
50

raop

RAOP Client is an Airport Express client written in ruby. It allows you to stream music to an Airport Express from Ruby.
Ruby
24
star
51

lolwut

Demo of SSE and reloading with AC::Live
Ruby
23
star
52

purdytest

Colorized output for minitest
Ruby
23
star
53

qrtools

QR Decoder for Ruby. Uses libdecodeqr
C++
22
star
54

dejour

find awesome stuff on the network
Ruby
22
star
55

playpen

A wrapper around the OS X security library
Ruby
21
star
56

geera

A commandline client for JIRA
Ruby
20
star
57

rjson

An JSON parser written with Racc
Ruby
20
star
58

widen

A library for narrowing and widening characters
Ruby
19
star
59

arghhh

I can't figure out SSL, please help!
Ruby
19
star
60

heap-utils

Just random scripts I'm using for Ruby heap info
Ruby
19
star
61

icanhasaudio

I am in ur computar, encodin' and decodin' ur MP3z.
C
19
star
62

housefire

Dumb campfire clone
Ruby
18
star
63

xml_truth

A collection of XML/HTML parser benchmarks for Ruby
Ruby
18
star
64

tldr

Too Long Didn't Run
Ruby
17
star
65

adequatehq.com

Adequate HQ
17
star
66

stree

A wrapper around libstree
C
16
star
67

allocation_sampler

C
16
star
68

wreckster

A Ruby API for Rexster
Ruby
15
star
69

chicken-yaml

libyaml wrapper for chicken scheme
Scheme
15
star
70

ruby-pprof

A Ruby program for parsing gperftools output
Ruby
14
star
71

uchip

Ruby library for interacting with MCP2221 and MCP2221a
Ruby
14
star
72

betabrite

This is a ruby API for the BetaBrite LED sign
Ruby
14
star
73

orient

Binary protocol implementation for Orient DB and Ruby
Ruby
14
star
74

fsmjs

Simulating fsm in JS
14
star
75

imgur2

Quick hack for uploading to imgur
Ruby
13
star
76

roastr

My Christmas roast
R
13
star
77

zomg

An OMG IDL parser and ruby code generator
Ruby
12
star
78

quail

Zero MQ ruby wrapper
Ruby
12
star
79

jit_buffer

General purpose buffer for use with building JITs
Ruby
10
star
80

hacks

Code for accessing CRuby constants and functions as Ruby
Ruby
10
star
81

meow

Meow gives you access to Growl notifications using RubyCocoa
Ruby
10
star
82

awkward

Produce dot files that represent your object graph
Ruby
10
star
83

libxml2

my fork of libxml2
C
10
star
84

mallcop

libssh2 wrapper
Ruby
9
star
85

milton

Ruby
9
star
86

odinflex

Different utilities that I've written
Ruby
9
star
87

remotehash

An OpenDHT client library
Ruby
9
star
88

wank

Ruby
9
star
89

WORF

WORF, the DWARF parser
Ruby
9
star
90

kedama

A wrapper around ming. Create swf files in ruby using ming.
Ruby
9
star
91

rubypan

Ruby
8
star
92

tree_diff

Parse html using different parsers, then show differences between the generated trees
Ruby
8
star
93

hatstone

A minimal Ruby wrapper for Capstone disassembler
C++
8
star
94

e-zine

My E-Zine
7
star
95

rsat

A pure Ruby SAT solver
Ruby
7
star
96

tenderlove.github.com

My awesome website
HTML
7
star
97

myhidapi

A wrapper around hidapi for Ruby
C
7
star
98

compiler

Proof of concept for converting Journey routes to state tables
Ruby
7
star
99

magic

I found some of my old code from 2004 on a USB stick. This code is not for use, it's just for fun
Roff
7
star
100

hearts

I love hearts!
Ruby
6
star