A simple meter using Adafruit 2.8 TFT with touch v2
Dependencies: SPI_STMPE610 UniGraphic mbed vt100
A dumb simple voltage tester using ADC.
With FRDM-KL25Z, you can measure about 0V to 3.28V.
Nothing to drop your jaw nor holding your breath
but I wanted one, so I wrote one ;-)
とても単純はADCを使用した電圧テスターです。
FRDM-KL25Z を使用した場合、0V ~ 3.28V くらいが測定範囲です。
特に目新しいことも、驚くこともありませんが、
自分が欲しいので書いてみました (^ - ^)
On 18-May-2018
I changed the number display from 0.00 to 0.000
so that I can measure the change of a small loadcell.
2018年5月18日
ロードセル (重量センサ)の出力値の変化を見たかったので
有効数字を小数点以下2桁から3桁に変更しました。
meter.h
- Committer:
- Rhyme
- Date:
- 2018-05-18
- Revision:
- 4:0607a2a46238
- Parent:
- 3:bf8761c8eb17
File content as of revision 4:0607a2a46238:
#ifndef _METER_H_
#define _METER_H_
/**
* meter class
* A simple analog style meter
**/
class meter {
public:
/**
* meter constructor
* @param x right-top position of meter
* @param y right-top position of meter
* @param width width of meter
* @param height height of meter
* @param min minimum value of meter
* @param max maximum value of meter
*/
meter(int x, int y, int width, int height, float min, float max) ;
/**
* meter destructor
*/
~meter(void) ;
/**
* drawFrame draw meter frame/canvas
*/
void drawFrame(void) ;
/**
* drawScale draw measuring mark
*/
void drawScale(void) ;
/**
* drawHand draw meter hand at value position
* @param value value to plot the hand
*/
void drawHand(float value) ;
/**
* drawValue draw textual value in the lower part of the meter
* @param value value to display (voltage assumed)
*/
void drawValue(float value) ;
/**
* draw draw full set of the meter
* @param value value to display and put hand
*/
void draw(float value) ;
/**
* update draw only hand and value text
*/
void update(float value) ;
private:
int _x ;
int _y ;
int _w ;
int _h ;
int _center_x ;
int _center_y ;
float _min ;
float _max ;
} ;
#endif /* _METER_H_ */