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