44 lines
1.4 KiB
C++
44 lines
1.4 KiB
C++
#include <DFRobot_ST7687S_Latch.h>
|
|
|
|
#define CBC_DISPLAY_BACKCOLOR DISPLAY_BLACK
|
|
|
|
#define TACHO_RADIUS 60
|
|
#define TACHO_DEFAULT_COLOR DISPLAY_CYAN
|
|
#define TACHO_BOOST_COLOR DISPLAY_RED
|
|
#define TACHO_LABEL_COLOR DISPLAY_WHITE
|
|
#define TACHO_OPEN 1500
|
|
#define TACHO_CLOSE TACHO_OPEN + 2995
|
|
#define TACHO_NEEDLE_LENGTH 50
|
|
#define TACHO_NEEDLE_COLOR DISPLAY_GREEN
|
|
#define TACHO_NEEDLE_WIDTH 3
|
|
#define TACHO_MAX_SPEED 65
|
|
|
|
#define AMPMETER_OPEN 2000
|
|
#define AMPMETER_CLOSE TACHO_OPEN + 2000
|
|
#define AMPMETER_RADIUS 64
|
|
#define AMPMETER_MAX 100
|
|
|
|
#define PAS_TEXTSIZE 5
|
|
#define PAS_COLOR DISPLAY_CYAN
|
|
|
|
#define REGENBRAKE_FAULT_COLOR DISPLAY_ORANGE
|
|
#define THROTTLE_FAULT_COLOR DISPLAY_ORANGE
|
|
|
|
class DFRobot_ST7687S_Widgets : public DFRobot_ST7687S_Latch {
|
|
public:
|
|
DFRobot_ST7687S_Widgets (uint8_t pin_cs, uint8_t pin_cd, uint8_t pin_wr, uint8_t pin_rck);
|
|
void Tacho();
|
|
void AmpMeter(int value);
|
|
void TachoLabels();
|
|
void TachoNeedle(uint8_t speed);
|
|
void drawLine2(int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t color);
|
|
void PasDisplay(int value);
|
|
|
|
private:
|
|
void labelText(int16_t* pX, int16_t* pY, const char* ch);
|
|
unsigned int rainbow(byte value);
|
|
|
|
bool labels_written;
|
|
int8_t old_needle_pos[];
|
|
int8_t needle_pos[];
|
|
}; |