Example complex keybrd sketch | Example complex keybrd sketch | ||||
----------------------------- | ----------------------------- | ||||
The keybrd_DH emulates the DataHand keyboard. | The keybrd_DH emulates the DataHand keyboard. | ||||
It has 72 keys, 4 layers, a sub-layer, 2 matrices, and many features. | |||||
It has 72 keys, 4 layers, 6 sub-layers, 2 matrices, 8 LEDs, and blinking LEDs. | |||||
The keybrd_DH and its instantiation files contain about 800 lines of code. | The keybrd_DH and its instantiation files contain about 800 lines of code. | ||||
[mainSketch.ino](https://github.com/wolfv6/keybrd_DH/blob/master/examples/keybrd_DH/mainSketch.cpp)<br> | [mainSketch.ino](https://github.com/wolfv6/keybrd_DH/blob/master/examples/keybrd_DH/mainSketch.cpp)<br> |
## [Unreleased][unreleased] | ## [Unreleased][unreleased] | ||||
## [0.3.1] - 2016-05-30 | |||||
### Changed | |||||
* Rename StateLayers to LayerState | |||||
## [0.3.0] - 2016-05-09 | ## [0.3.0] - 2016-05-09 | ||||
### Changed | ### Changed | ||||
* Restructured the project directory to conform to Arduino library manager specifications | * Restructured the project directory to conform to Arduino library manager specifications |
* 5 volts across power and ground | * 5 volts across power and ground | ||||
* To validate keyboard hardware, modify the simple single-layer keybrd sketch from the tutorial. | * To validate keyboard hardware, modify the simple single-layer keybrd sketch from the tutorial. | ||||
<!-- todo after teensy LC bb, linke to minimal keybrd sketch | |||||
<!-- todo after teensy LC bb, link to minimal keybrd sketch | |||||
[minimal keybrd sketch](blob/master/tutorials/keybrd_2_single-layer_annotated/keybrd_2_single-layer_annotated.ino). | [minimal keybrd sketch](blob/master/tutorials/keybrd_2_single-layer_annotated/keybrd_2_single-layer_annotated.ino). | ||||
--> | --> | ||||
Top priority | Top priority | ||||
============ | ============ | ||||
Add interrupts for I2C | |||||
Redesign elements of debouncer. | |||||
Med priority | Med priority | ||||
============ | ============ | ||||
Low priority | Low priority | ||||
============ | ============ | ||||
Add matrix-to-layout transform array (to decouple matrix from layout) | |||||
Add matrix-to-layout mapping array (to decouple matrix from layout) | |||||
Change tutorial sketches from teensy 2.0 and PCA9655E-D IOE to Teensy LC and MCP23018 IOE | Change tutorial sketches from teensy 2.0 and PCA9655E-D IOE to Teensy LC and MCP23018 IOE | ||||
/* LED is an abstract base class | /* LED is an abstract base class | ||||
Each LED object is an IC pin that is used to power an LED on and off. | Each LED object is an IC pin that is used to power an LED on and off. | ||||
Connect the LED in series with the resistor: | |||||
Calculate current-limiting-resistor value (100 Ohms to 10k Ohms will work with 5 volts) | |||||
R = (Vs - Vf) / If | |||||
http://www.digikey.com/en/resources/conversion-calculators/conversion-calculator-led-series-resistor | |||||
Connect the LED's anode (the longer lead) to the AVR output pin (+) | |||||
Connect the LED's cathode to ground (-) | |||||
Never connect a LED directly from ground to power. Doing so would destroy the LED. | |||||
*/ | */ | ||||
class LED | class LED | ||||
{ | { |
## Pseudo code for simple layer scheme | ## Pseudo code for simple layer scheme | ||||
The following pseudo code has just enough detail to show how layer schemes work. | The following pseudo code has just enough detail to show how layer schemes work. | ||||
**Key_Layer** objects select the active layer. | |||||
**Key_Layer** objects are used to select an active layer. | |||||
The "layer" variable is a layer id number. | The "layer" variable is a layer id number. | ||||
When a Key_Layer object is pressed, it tells LayerState to update the active layer. | When a Key_Layer object is pressed, it tells LayerState to update the active layer. | ||||
``` | ``` | ||||
} | } | ||||
``` | ``` | ||||
**Key_Layered** objects contain multiple Key pointers, one Key pointer for each layer. | |||||
Layer ids are used like indexes to select the appropriate key. | |||||
When a Key_Layered object is pressed, it gets the active layer from LayerState, and then sends the key of the active layer. | |||||
**Key_Layered** objects contain multiple elements, one element for each layer. | |||||
Layer ids are used like indexes to send the appropriate element. | |||||
When a Key_Layered object is pressed, it gets the active layer from LayerState, and then sends the appropriate element. | |||||
``` | ``` | ||||
class Key_Layered | class Key_Layered | ||||
{ | { |