Correct Widget examples
This commit is contained in:
parent
90fe790ff9
commit
333f0f845c
|
|
@ -1,9 +1,9 @@
|
||||||
// Button widget demo, requires display with touch screen
|
// Button widget demo, requires SPI display with touch screen
|
||||||
|
|
||||||
// Requires widget library here:
|
// Requires widget library here:
|
||||||
// https://github.com/Bodmer/TFT_eWidget
|
// https://github.com/Bodmer/TFT_eWidget
|
||||||
|
|
||||||
#include "FS.h"
|
#include <FS.h>
|
||||||
#include "Free_Fonts.h" // Include the header file attached to this sketch
|
#include "Free_Fonts.h" // Include the header file attached to this sketch
|
||||||
|
|
||||||
#include <TFT_eSPI.h> // Hardware-specific library
|
#include <TFT_eSPI.h> // Hardware-specific library
|
||||||
|
|
@ -14,15 +14,15 @@ TFT_eSPI tft = TFT_eSPI(); // Invoke custom library
|
||||||
#define CALIBRATION_FILE "/TouchCalData1"
|
#define CALIBRATION_FILE "/TouchCalData1"
|
||||||
#define REPEAT_CAL false
|
#define REPEAT_CAL false
|
||||||
|
|
||||||
TFT_eWidget btnL = TFT_eWidget(&tft);
|
ButtonWidget btnL = ButtonWidget(&tft);
|
||||||
TFT_eWidget btnR = TFT_eWidget(&tft);
|
ButtonWidget btnR = ButtonWidget(&tft);
|
||||||
|
|
||||||
#define BUTTON_W 100
|
#define BUTTON_W 100
|
||||||
#define BUTTON_H 50
|
#define BUTTON_H 50
|
||||||
|
|
||||||
// Create an array of button instances to use in for() loops
|
// Create an array of button instances to use in for() loops
|
||||||
// This is more useful where large numbers of buttons are employed
|
// This is more useful where large numbers of buttons are employed
|
||||||
TFT_eWidget* btn[] = {&btnL , &btnR};;
|
ButtonWidget* btn[] = {&btnL , &btnR};;
|
||||||
uint8_t buttonCount = sizeof(btn) / sizeof(btn[0]);
|
uint8_t buttonCount = sizeof(btn) / sizeof(btn[0]);
|
||||||
|
|
||||||
void btnL_pressAction(void)
|
void btnL_pressAction(void)
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
// https://github.com/Bodmer/TFT_eWidget
|
// https://github.com/Bodmer/TFT_eWidget
|
||||||
|
|
||||||
#include "FS.h"
|
#include "FS.h"
|
||||||
#include <LittleFS.h>
|
|
||||||
#include "Free_Fonts.h" // Include the header file attached to this sketch
|
#include "Free_Fonts.h" // Include the header file attached to this sketch
|
||||||
|
|
||||||
#include <TFT_eSPI.h>
|
#include <TFT_eSPI.h>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue