Allows for a 90 frame animated gauge to be display on the uLCD

Dependents:   uLCDgaugeTest

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers uLCD_gauges.h Source File

uLCD_gauges.h

00001 #ifndef ULCD_GAUGES_H
00002 #define ULCD_GAUGES_H
00003  
00004 #include "uLCD_4DGL.h"
00005 #include "mbed.h"
00006 
00007 /** 
00008 *   Header file for uLCD gauges library
00009 */
00010 class uLCD_gauges {
00011 public:
00012     /**
00013     * Constructor for the uLCD_gauges class. Sets up the value mapping assuming the default gauge is used.
00014     * @param screen The uLCD instance that is going to be used for the gauge
00015     * @param min The minimum value the gauge wil be updated with. Used for mapping.
00016     * @param max The maximum value the gauge wil be updated with. Used for mapping.
00017     */
00018     uLCD_gauges(uLCD_4DGL& screen, float min, float max);
00019     /**
00020     * Constructor for the uLCD_gauges class. Sets up the value mapping for custom gauges.
00021     * @param screen The uLCD instance that is going to be used for the gauge
00022     * @param min The minimum value the gauge wil be updated with. Used for mapping.
00023     * @param max The maximum value the gauge wil be updated with. Used for mapping.
00024     * @param memoryAddressHigh The ending memory address of the animation that will be displayed as a gauge.
00025     * @param memoryAddressLow The starting memory address of the animation that will be displayed as a gauge.
00026     */
00027     uLCD_gauges(uLCD_4DGL& screen, float min, float max, int lowF, int highF, long memoryAddressHigh, long memoryAddressLow);
00028     /**
00029     * This method repares the uLCD for displaying the gauge. Must be called once after object instancing
00030     */
00031     void start();
00032     /**
00033     * This method updates the gauge based on the new input value
00034     * @param value The value to be mapped onto the display
00035     */
00036     void update(float value);
00037   
00038 private:  
00039     uLCD_4DGL *uLCD;
00040     float minVal;
00041     float maxVal;
00042     float mapOffset;
00043     float mapSlope;
00044     float highFrame;
00045     long memHigh;
00046     long memLow;
00047 };
00048  
00049 #endif