Alphanumeric display for iHvZ
AlphaNumDisplay.hpp@2:48d04cc40e1c, 2010-12-12 (annotated)
- Committer:
- etherealflaim
- Date:
- Sun Dec 12 06:42:30 2010 +0000
- Revision:
- 2:48d04cc40e1c
- Parent:
- 1:d5692deaa688
Updated hpp comments
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
etherealflaim | 0:410a1870af10 | 1 | #ifndef _AlphaNumDisplayH |
etherealflaim | 0:410a1870af10 | 2 | #define _AlphaNumDisplayH |
etherealflaim | 0:410a1870af10 | 3 | |
etherealflaim | 0:410a1870af10 | 4 | #include "mbed.h" |
etherealflaim | 0:410a1870af10 | 5 | #define ALPHA_NUM_SYMBOLS 39 |
etherealflaim | 0:410a1870af10 | 6 | #define ALPHA_NUM_CHECK '^' |
etherealflaim | 0:410a1870af10 | 7 | #define ALPHA_NUM_CHECK_I 38 |
etherealflaim | 0:410a1870af10 | 8 | #define ALPHA_NUM_STAR '*' |
etherealflaim | 0:410a1870af10 | 9 | #define ALPHA_NUM_STAR_I 37 |
etherealflaim | 0:410a1870af10 | 10 | #define ALPHA_NUM_CLEAR ' ' |
etherealflaim | 0:410a1870af10 | 11 | #define ALPHA_NUM_CLEAR_I 10 |
etherealflaim | 0:410a1870af10 | 12 | #define ALPHA_NUM_A_I 11 |
etherealflaim | 0:410a1870af10 | 13 | #define ALPHA_NUM_ZERO_I 0 |
etherealflaim | 0:410a1870af10 | 14 | |
etherealflaim | 2:48d04cc40e1c | 15 | |
etherealflaim | 2:48d04cc40e1c | 16 | /** This class creates an 11 pin connection to an |
etherealflaim | 2:48d04cc40e1c | 17 | * alpha numeric display. Is capable of displaying |
etherealflaim | 2:48d04cc40e1c | 18 | * all alphanumeric characters, a check mark ('^'), |
etherealflaim | 2:48d04cc40e1c | 19 | * a star ('*') or nothing (' '). |
etherealflaim | 2:48d04cc40e1c | 20 | */ |
etherealflaim | 0:410a1870af10 | 21 | class AlphaNumDisplay { |
etherealflaim | 0:410a1870af10 | 22 | |
etherealflaim | 0:410a1870af10 | 23 | private: |
etherealflaim | 0:410a1870af10 | 24 | // Display bars |
etherealflaim | 2:48d04cc40e1c | 25 | DigitalOut m_htop; ///< Top Horizontal Bar |
etherealflaim | 2:48d04cc40e1c | 26 | DigitalOut m_hmiddle; ///< Middle Horizontal Bar |
etherealflaim | 2:48d04cc40e1c | 27 | DigitalOut m_hbottom; ///< Bottom Horizontal Bar |
etherealflaim | 2:48d04cc40e1c | 28 | DigitalOut m_vtopleft; ///< Top Left Vertical Bar |
etherealflaim | 2:48d04cc40e1c | 29 | DigitalOut m_vbottomleft; ///< Bottom Left Vertical Bar |
etherealflaim | 2:48d04cc40e1c | 30 | DigitalOut m_vtopmiddle; ///< Top Middle Vertical Bar |
etherealflaim | 2:48d04cc40e1c | 31 | DigitalOut m_vbottommiddle; ///< Bottom Middle Vertical Bar |
etherealflaim | 2:48d04cc40e1c | 32 | DigitalOut m_vtopright; ///< Top Right Vertical Bar |
etherealflaim | 2:48d04cc40e1c | 33 | DigitalOut m_vbottomright; ///< Bottom Right Vertical Bar |
etherealflaim | 2:48d04cc40e1c | 34 | DigitalOut m_dtopleft; ///< Top left to bottom right |
etherealflaim | 2:48d04cc40e1c | 35 | DigitalOut m_dtopright; ///< Bottom left to top right |
etherealflaim | 2:48d04cc40e1c | 36 | static unsigned char m_alphadisplay[][11]; ///< Table of symbols |
etherealflaim | 0:410a1870af10 | 37 | |
etherealflaim | 0:410a1870af10 | 38 | public: |
etherealflaim | 2:48d04cc40e1c | 39 | /** output pins using the naming scheme of h - horizontal, v - vertical, |
etherealflaim | 2:48d04cc40e1c | 40 | * d - diagonal, t - top, b - bottom, l - left, r - right, m - middle |
etherealflaim | 2:48d04cc40e1c | 41 | */ |
etherealflaim | 1:d5692deaa688 | 42 | AlphaNumDisplay(PinName ht, PinName hm, PinName hb, PinName vtl, |
etherealflaim | 1:d5692deaa688 | 43 | PinName vbl, PinName vtm, PinName vbm, PinName vtr, |
etherealflaim | 1:d5692deaa688 | 44 | PinName vbr, PinName dtl, PinName dtr); |
etherealflaim | 2:48d04cc40e1c | 45 | /** display the character. Case insensitive. Numerals can be |
etherealflaim | 2:48d04cc40e1c | 46 | * input either as their numerical value or as characters. |
etherealflaim | 2:48d04cc40e1c | 47 | * '^' for check mark, '*' for star, ' ' for space. |
etherealflaim | 2:48d04cc40e1c | 48 | */ |
etherealflaim | 2:48d04cc40e1c | 49 | void display(unsigned char c); |
etherealflaim | 0:410a1870af10 | 50 | |
etherealflaim | 0:410a1870af10 | 51 | }; |
etherealflaim | 0:410a1870af10 | 52 | |
etherealflaim | 0:410a1870af10 | 53 | #endif |