keybrd library is an open source library for creating custom-keyboard firmware.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

tutorial_7ab_mapping_layout_to_matix.md 3.0KB

keybrd Tutorial 7ab - mapping layout to matrix

After reading this tutorial you will be able to map a keyboard layout to a keyboard matrix.

Keyboard mapping nomenclature

Keyboard layout - is the placement of keys. Key caps are often labeled to show a keyboard’s layout.

Matrix - is a collection of switches electrically connected into rows and columns.

Transpose - is the mapping of layout rows to matrix columns. Used when diodes are oriented with anodes towards the matrix rows.

When to use mapping

In most of the other keybrd tutorial examples:

  • layout and matrix are congruent
  • active-low keyboard diodes are oriented with cathodes towards the matrix rows (or active-high keyboard diodes are oriented with anodes towards the matrix rows)

There is no standard way keyboards are manufactured. Some variations are:

  • irregular matrix
  • active-low keyboard diodes are oriented with anodes towards the matrix rows
  • active-high keyboard diodes are oriented with cathodes towards the matrix rows
  • I/O expander pins connect to matrix out of order

Any of these variations can use a mapping to align a layout with the matrix.

Mapping a layout to a matrix

Modify the basic breadboard keyboard by flipping diodes, so that anodes are towards matrix rows (blue bus). The keybrd_7a_mapping_single-layer.ino sketch will run on the keyboard. Annotations in the sketch explain how mapping from LAYOUT to MATRIX works.

The keybrd_7b_mapping_multi-layer.ino sketch will run on the same keyboard.

Exercise

1) Make a keyboard with an irregular matrix.

  • Modify the basic breadboard keyboard by crossing the columns.
  • Modify the keybrd_2_single-layer.ino sketch by mapping the layout to the irregular matrix.

crossed columns


Creative Commons License
keybrd tutorial by Wolfram Volpi is licensed under a Creative Commons Attribution 4.0 International License.
Permissions beyond the scope of this license may be available at https://github.com/wolfv6/keybrd/issues/new.