simple GUI elements for drawing on a canvas, works with adafruit graphics lib

Dependents:   ezSBC_MPU9250

Revision:
0:ccdf1edcbba6
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Controls.h	Mon Apr 24 16:21:53 2017 +0000
@@ -0,0 +1,35 @@
+#ifndef _Controls_h_
+#define _Controls_h_
+
+#include "mbed.h"
+#include "SmallGUIBase.h"
+
+#if (USE_BARGRAPH == 1)
+class barGraph : public baseControl
+{
+    public:
+    enum bgOrientation {bgHorizontal, bgVertical};
+    
+    barGraph(bgOrientation orientation, int16_t x0, int16_t y0, int16_t x1, int16_t y1);
+    
+    void setScale(float valMin, float valMax);
+    void setValue(float val);
+    
+    virtual void draw(Adafruit_GFX &canvas);
+    
+    private:
+    bgOrientation   orientation;
+    int16_t x0;
+    int16_t y0;
+    int16_t x1;
+    int16_t y1;
+    int16_t zeroPos;
+    float valMin;
+    float valMax;
+    float valScaleFactor;
+    float val;
+    
+};
+#endif
+
+#endif