Allows for a 90 frame animated gauge to be display on the uLCD
uLCD_gauges.h@6:14f231bc42cc, 2015-03-13 (annotated)
- Committer:
- Striker121
- Date:
- Fri Mar 13 15:41:09 2015 +0000
- Revision:
- 6:14f231bc42cc
- Parent:
- 5:df405a69bb31
- Child:
- 7:761059a69344
dOxygen Stuff
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Striker121 | 5:df405a69bb31 | 1 | #ifndef ULCD_GAUGES_H |
Striker121 | 5:df405a69bb31 | 2 | #define ULCD_GAUGES_H |
Striker121 | 5:df405a69bb31 | 3 | |
Striker121 | 5:df405a69bb31 | 4 | #include "uLCD_4DGL.h" |
Striker121 | 5:df405a69bb31 | 5 | #include "mbed.h" |
Striker121 | 5:df405a69bb31 | 6 | |
Striker121 | 6:14f231bc42cc | 7 | /** Header file for uLCD gauges library |
Striker121 | 2:38006c26dda5 | 8 | * @file uLCD_gauges.h |
Striker121 | 2:38006c26dda5 | 9 | * @brief This header file lists the functions needed to control gauge display on the uLCD |
Striker121 | 2:38006c26dda5 | 10 | * |
Striker121 | 2:38006c26dda5 | 11 | * @author Matthew Arceri and Harsha Nori |
Striker121 | 2:38006c26dda5 | 12 | * |
Striker121 | 2:38006c26dda5 | 13 | * @date 3/13/2015 |
Striker121 | 2:38006c26dda5 | 14 | */ |
Striker121 | 5:df405a69bb31 | 15 | |
Striker121 | 0:9101c0ce36a1 | 16 | class uLCD_gauges { |
Striker121 | 0:9101c0ce36a1 | 17 | public: |
Striker121 | 4:069b01d563a3 | 18 | /** |
Striker121 | 4:069b01d563a3 | 19 | * Constructor for the uLCD_gauges class. Sets up the value mapping assuming the default gauge is used. |
Striker121 | 4:069b01d563a3 | 20 | * @param screen The uLCD instance that is going to be used for the gauge |
Striker121 | 4:069b01d563a3 | 21 | * @param min The minimum value the gauge wil be updated with. Used for mapping. |
Striker121 | 4:069b01d563a3 | 22 | * @param max The maximum value the gauge wil be updated with. Used for mapping. |
Striker121 | 4:069b01d563a3 | 23 | */ |
Striker121 | 0:9101c0ce36a1 | 24 | uLCD_gauges(uLCD_4DGL& screen, float min, float max); |
Striker121 | 4:069b01d563a3 | 25 | /** |
Striker121 | 4:069b01d563a3 | 26 | * Constructor for the uLCD_gauges class. Sets up the value mapping for custom gauges. |
Striker121 | 4:069b01d563a3 | 27 | * @param screen The uLCD instance that is going to be used for the gauge |
Striker121 | 4:069b01d563a3 | 28 | * @param min The minimum value the gauge wil be updated with. Used for mapping. |
Striker121 | 4:069b01d563a3 | 29 | * @param max The maximum value the gauge wil be updated with. Used for mapping. |
Striker121 | 4:069b01d563a3 | 30 | * @param memoryAddressHigh The ending memory address of the animation that will be displayed as a gauge. |
Striker121 | 4:069b01d563a3 | 31 | * @param memoryAddressLow The starting memory address of the animation that will be displayed as a gauge. |
Striker121 | 4:069b01d563a3 | 32 | */ |
Striker121 | 2:38006c26dda5 | 33 | uLCD_gauges(uLCD_4DGL& screen, float min, float max, int lowF, int highF, long memoryAddressHigh, long memoryAddressLow); |
Striker121 | 4:069b01d563a3 | 34 | /** |
Striker121 | 4:069b01d563a3 | 35 | * This method repares the uLCD for displaying the gauge. Must be called once after object instancing |
Striker121 | 4:069b01d563a3 | 36 | */ |
Striker121 | 0:9101c0ce36a1 | 37 | void start(); |
Striker121 | 4:069b01d563a3 | 38 | /** |
Striker121 | 4:069b01d563a3 | 39 | * This method updates the gauge based on the new input value |
Striker121 | 4:069b01d563a3 | 40 | * @param value The value to be mapped onto the display |
Striker121 | 4:069b01d563a3 | 41 | */ |
Striker121 | 0:9101c0ce36a1 | 42 | void update(float value); |
Striker121 | 0:9101c0ce36a1 | 43 | |
Striker121 | 0:9101c0ce36a1 | 44 | private: |
Striker121 | 0:9101c0ce36a1 | 45 | uLCD_4DGL *uLCD; |
Striker121 | 0:9101c0ce36a1 | 46 | float minVal; |
Striker121 | 0:9101c0ce36a1 | 47 | float maxVal; |
Striker121 | 0:9101c0ce36a1 | 48 | float mapOffset; |
Striker121 | 0:9101c0ce36a1 | 49 | float mapSlope; |
Striker121 | 2:38006c26dda5 | 50 | float highFrame; |
Striker121 | 1:5666427710f2 | 51 | long memHigh; |
Striker121 | 1:5666427710f2 | 52 | long memLow; |
Striker121 | 0:9101c0ce36a1 | 53 | }; |
Striker121 | 0:9101c0ce36a1 | 54 | |
Striker121 | 0:9101c0ce36a1 | 55 | #endif |