Skip to content

Commit

Permalink
Update examples for ESP32
Browse files Browse the repository at this point in the history
  • Loading branch information
Nkawu committed Apr 5, 2022
1 parent fdc2ea1 commit 2f37f20
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 11 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ TFT_22_ILI9225

Version | Release Date | Description
------- | ------------ | -----------
[v1.4.5](https://github.com/Nkawu/TFT_22_ILI9225/releases/tag/v1.4.5) | 2022-02-05 | Update examples for ESP32
[v1.4.4](https://github.com/Nkawu/TFT_22_ILI9225/releases/tag/v1.4.4) | 2020-07-19 | Add support for Arduino Nano Every ([charclo](https://github.com/charclo))
[v1.4.3](https://github.com/Nkawu/TFT_22_ILI9225/releases/tag/v1.4.3) | 2019-11-25 | Cleanup and ESP32 FAST_PINIO fixes ([Bolukan](https://github.com/Bolukan) [dl9rdz](https://github.com/dl9rdz))
[v1.4.2](https://github.com/Nkawu/TFT_22_ILI9225/releases/tag/v1.4.2) | 2019-05-01 | More performance improvements for color drawBitmap ([LAK132](https://github.com/LAK132))
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ TFT_22_ILI9225

Version | Release Date | Description
------- | ------------ | -----------
[v1.4.4](https://github.com/Nkawu/TFT_22_ILI9225/releases/tag/v1.4.4) | 2020-07-19 | Add support for Arduino Nano Every ([charclo](https://github.com/charclo))
[v1.4.5](https://github.com/Nkawu/TFT_22_ILI9225/releases/tag/v1.4.5) | 2022-02-05 | Update examples for ESP32

## Introduction

Expand All @@ -25,7 +25,7 @@ ILI9341 driver.*
* Include Library
* Manage Libraries...
* In the resulting **Library Manager** dialog:
* Enter **"9225"** in the search filter field *(Filter your search...)*
* Enter **"ILI9225"** in the search filter field *(Filter your search...)*
* Select **TFT_22_ILI9225"** in the list
* Click the **Install** button

Expand Down
2 changes: 1 addition & 1 deletion examples/Basic_Demo/Basic_Demo.ino
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#define TFT_CS PA0 // SS
#define TFT_SDI PA7 // MOSI
#define TFT_CLK PA5 // SCK
#define TFT_LED 0 // 0 if wired to +5V directly
#define TFT_LED 0 // 0 if wired to +5V directly
#elif defined(ESP8266)
#define TFT_RST 4 // D2
#define TFT_RS 5 // D1
Expand Down
8 changes: 7 additions & 1 deletion examples/GFX_Font_Demo/GFX_Font_Demo.ino
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
//#define TFT_SDO 12 // HSPI-MISO
#define TFT_SDI 13 // HSPI-MOSI
#define TFT_CS 15 // HSPI-SS0
#define TFT_LED 0 // 0 if wired to +5V directly
#define TFT_LED 0 // 0 if wired to +5V directly
SPIClass hspi(HSPI);
#else
#define TFT_RST 8
#define TFT_RS 9
Expand All @@ -53,7 +54,12 @@ int16_t x=0, y=0, w, h;

// Setup
void setup() {
#if defined(ESP32)
hspi.begin();
tft.begin(hspi);
#else
tft.begin();
#endif
tft.clear();

// Draw first string in big font
Expand Down
15 changes: 10 additions & 5 deletions examples/Triangle_Demo/Triangle_Demo.ino
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#define TFT_CS PA0 // SS
#define TFT_SDI PA7 // MOSI
#define TFT_CLK PA5 // SCK
#define TFT_LED 0 // 0 if wired to +5V directly
#define TFT_LED 0 // 0 if wired to +5V directly
#elif defined(ESP8266)
#define TFT_RST 4 // D2
#define TFT_RS 5 // D1
Expand All @@ -22,10 +22,11 @@
#define TFT_RST 26 // IO 26
#define TFT_RS 25 // IO 25
#define TFT_CLK 14 // HSPI-SCK
//#define TFT_SDO 12 // HSPI-MISO
// #define TFT_SDO 12 // HSPI-MISO
#define TFT_SDI 13 // HSPI-MOSI
#define TFT_CS 15 // HSPI-SS0
#define TFT_LED 0 // 0 if wired to +5V directly
#define TFT_LED 0 // 0 if wired to +5V directly
SPIClass hspi(HSPI);
#else
#define TFT_RST 8
#define TFT_RS 9
Expand All @@ -39,8 +40,7 @@

#define ROTATE_ANGLE 10 // Angle in degrees to rotate the triangle

struct _point
{
struct _point {
int16_t x;
int16_t y;
};
Expand All @@ -53,7 +53,12 @@ _point c1, c2, c3, cc;

// Setup
void setup() {
#if defined(ESP32)
hspi.begin();
tft.begin(hspi);
#else
tft.begin();
#endif

// Define triangle start coordinates
c1.x = 30; c1.y = 30;
Expand Down
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"authors": {
"name": "Nkawu"
},
"version": "1.4.4",
"version": "1.4.5",
"frameworks": "arduino",
"platforms": "*"
}
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=TFT_22_ILI9225
version=1.4.4
version=1.4.5
author=Nkawu
maintainer=Nkawu
sentence=ILI9225 2.2" 176x220 TFT LCD shield
Expand Down

0 comments on commit 2f37f20

Please sign in to comment.