Hi All,
Here I share the complete Figgipad Encoder which provides full keyboard use of a PC (Mac) terminal connected to FIGnition via Arduino.
Connections Arduino -> FIGnition:
Gnd -> Gnd
D2 -> PB0, D3 -> PD7
D4 -> PC0, D5 -> PC1, D6 -> PC2, D7 -> PC3
Features:
- Arduino is connected to PC via serial (over USB)
- a terminal program is used to type on PC
- typed characters are encoded in Arduino and "played" on Figgipad
- the speed is 4-5 char/sec, which is OK to keep up with normal typing and transfers an average block in just over a minute (details discussed
earlier)
Supported characters:
- all alpha-numeric
- all syntax chars in Figgipad
(which excludes tilda '~' and underscore '_' mysteriously omitted therein)
- Enter, Space, Backspace
- Arrow keys
- Special keys:
- Ctlr+A "Again" - repeat last key
- Ctrl+B "Begin" - set marker
- Ctrl+C "Command" - editor commands and octal character entry (lower, upper ASCII, _ and ~)
- Ctrl+D "Dup" - copy character from marker
- the Esc key, which exists from Figgy editor and can be used to exit other programs, needs to be pressed twice (as in Unix terminal programs)
Using PC clipboard
- paste snippets of code
- copy / paste previous code lines, which acts as command history
- transfer entire blocks from PC to FIGnition:
- enter block edit mode in FIGnition (nn edit)
- clear the block if contain old code ( Ctrl+C Z )
- copy block / paste to terminal
- observe until all characters are transfered
- save editied block (Ctrl+C W)
Design notes
- an additional memory buffer is used to accumlate the serial input, since the Arduino serial is limited to 128 chars and since key playing is much slower it runs out when pasting 500 character blocks
- to prevent lost characters, serial pumping is interated with key play and pausing
- serial speed is set to standard 9600 baud and is not essential due to memory buffer
Figgipad Encoding
- expressed in a hex matrix corresponding to ASCII
- to facilitate manual populating of the matrix, the following bit layout is used
S R C C n r c c <- LSB | | |/ | | \|---- col of key 2 | | | | +-------- row of key 2 | | | +---------- no key 2 | | +-------------- col of key 1 | +---------------- row of key 1 +------------------ shift - where upper and lower 4 bits are key 1 and 2 and shift adds 4th bit
- so the 2x4 Figgipad keys are represented as
0 1 2 3 shift: 8 9 A B 4 5 6 7 C D E F - mapping example
// 0 1 2 3 4 5 6 7 8 ...// 2 ' ' ! " # $ % & ' ( ... "\x68\x13\x17\x83\x53\x92\xD7\x97\x54 ...// 3 0 1 2 3 4 5 6 7 8 ... "\x46\x01\x02\x03\x05\x06\x41\x42\x43 ... Oleg
