Skip to content

Commit 07a570e

Browse files
committed
Fixes for #3
Conditional loading of LittleFS.h dependent on processor. Update example for new button class.
1 parent 63146c9 commit 07a570e

File tree

5 files changed

+15
-8
lines changed

5 files changed

+15
-8
lines changed

examples/Buttons/Button_demo/Button_demo.ino

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
// Button widget demo, requires display with touch screen
1+
// Button widget demo, requires SPI display with touch screen
22

33
// Requires widget library here:
44
// https://github.com/Bodmer/TFT_eWidget
55

6-
#include "FS.h"
6+
#include <FS.h>
77
#include "Free_Fonts.h" // Include the header file attached to this sketch
88

99
#include <TFT_eSPI.h> // Hardware-specific library
@@ -14,15 +14,15 @@ TFT_eSPI tft = TFT_eSPI(); // Invoke custom library
1414
#define CALIBRATION_FILE "/TouchCalData1"
1515
#define REPEAT_CAL false
1616

17-
TFT_eWidget btnL = TFT_eWidget(&tft);
18-
TFT_eWidget btnR = TFT_eWidget(&tft);
17+
ButtonWidget btnL = ButtonWidget(&tft);
18+
ButtonWidget btnR = ButtonWidget(&tft);
1919

2020
#define BUTTON_W 100
2121
#define BUTTON_H 50
2222

2323
// Create an array of button instances to use in for() loops
2424
// This is more useful where large numbers of buttons are employed
25-
TFT_eWidget* btn[] = {&btnL , &btnR};;
25+
ButtonWidget* btn[] = {&btnL , &btnR};;
2626
uint8_t buttonCount = sizeof(btn) / sizeof(btn[0]);
2727

2828
void btnL_pressAction(void)

examples/Sliders/Slider_demo/Slider_demo.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// https://github.com/Bodmer/TFT_eWidget
55

66
#include "FS.h"
7-
#include <LittleFS.h>
7+
88
#include "Free_Fonts.h" // Include the header file attached to this sketch
99

1010
#include <TFT_eSPI.h>

library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "TFT_eWidget",
3-
"version": "0.0.4",
3+
"version": "0.0.5",
44
"keywords": "Arduino, tft, display, button, gui, graph, meter, slider",
55
"description": "A TFT GUI widget library",
66
"repository":

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=TFT_eWidget
2-
version=0.0.4
2+
version=0.0.5
33
author=Bodmer
44
maintainer=Bodmer
55
sentence=A TFT GUI widget library

src/TFT_eWidget.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@
1111
//Standard support
1212
#include <Arduino.h>
1313

14+
// LittleFS is required for touch calibration in TFT_eSPI sketches
15+
#if defined (ESP8266) || defined (ESP32)
16+
#include <pgmspace.h>
17+
#include <FS.h>
18+
#include <LittleFS.h>
19+
#endif
20+
1421
#include <TFT_eSPI.h>
1522

1623
#include "widgets/button/ButtonWidget.h"

0 commit comments

Comments
 (0)