Example getkey

From wiki.emacinc.com
Revision as of 11:20, 14 November 2013 by Jgreene (talk | contribs)
Jump to: navigation, search
TODO: {{#todo:InProgress(11.14.13-11:04->JG+)|Jgreene|oe 4,oe 5,ky,md,InProgress}}

This procedure provides an overview of how to compile and run the getkey C example project. It assumes familiarity with the C programming language and is intended to be used by experienced programmers who are looking to learn the EMAC SDK.

1. Open the C/C++ editing perspective

2. Open the egpc project

3. Build, upload and run



What it does

This is an example program for mapping keypad input to a character matrix using the keypad interface on the SOM-150ES. It requires a SOM-150ES board and the keypad that goes with it.

Usage for getkey:
getkey [-d device -b -g -s file]
d: specify the device node, default is /dev/keypad
b: read blocking, sleep until a key is pressed.
g: get matrix returns the current keypad matrix.
s: sets the keypad matrix to the matrix specified in file (see project for example file Key-E020-21).
If a matrix operation is not specified then the last key pressed is returned.
Note:
Arguments are evaluated in order. If blocking or device specifications are used, they must be declared before the matrix arguments on the command line.

i.e. : ./getkey -d /dev/keypad0 -b