Class library for a touchscreen-based keypad for the LCD display present on the DISCO_F429ZI board.
Dependents: WIRE-BANDING_FT810 WIRE-BANDING_copy
Diff: KEYPAD_DISCO_F429ZI.h
- Revision:
- 4:9d6ea6fbb67f
- Parent:
- 3:5f2fa06a0492
--- a/KEYPAD_DISCO_F429ZI.h Sun May 08 21:11:54 2016 +0000 +++ b/KEYPAD_DISCO_F429ZI.h Tue May 10 21:02:52 2016 +0000 @@ -35,13 +35,30 @@ * Example: * @code * #include "mbed.h" - * #include "HCSR04.h" - * - * HCSR04 distance(PB_8, PA_1); - * + * #include "TS_DISCO_F429ZI.h" + * #include "LCD_DISCO_F429ZI.h" + * #include "KEYPAD_DISCO_F429ZI.h" + * + * KEYPAD_DISCO_F429ZI keypad; + * * int main() { - * while(1){ - * SWO.printf("Distance = %d (us) %f (cm)\n", distance.read_us(), distance.read_cm()); + * char buf[20]; + * char k, key; + * + * keypad.Show(1, 1); //Display the keypad, enable the Message and Output Box areas + * keypad.WriteMsgBoxLine(0, "Press any key..."); //display a message in the + * keypad.WriteMsgBoxLine(1, "----------------"); //Message Box area of the keypad + * + * while(1) { + * k = keypad.ReadKey(); //read the current key pressed + * if(k != '\0') { //if a key is pressed + * key = k; //store the key in a variable + * do //read until key is released + * k = keypad.ReadKey(); + * while(k != '\0'); + * sprintf(buf, "%c was pressed", key); + * keypad.WriteOutBox(buf); //display result in Output Box area of keypad + * } * } * } * @endcode @@ -83,7 +100,7 @@ /** Sets the ASCII characters for each key on the 4x4 keypad. * @param - * keymap Pointer to a two-dimensional array (array[3][3]) with ASCII characters for eahc key. + * keymap Pointer to a two-dimensional array (array[4][4]) with ASCII characters for each key. */ void SetKeys(char (*keymap)[4]);