Skip to content

Commit 1c88382

Browse files
committed
Merge branch 'master' of github.com:yoprogramo/QRcode_eSPI
2 parents cdae38f + 3856249 commit 1c88382

6 files changed

Lines changed: 22 additions & 15 deletions

File tree

README.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# QRcode_eSPI
22

3-
Subclass that you can use jointly with https://github.com/yoprogramo/QRcodeDisplay to generate QRcodes in TFT displays like ST7735
3+
Subclass that you can use jointly with https://github.com/yoprogramo/QRcodeDisplay to generate QRcodes in TFT displays like ST7735 and any other supported by TFT_eSPI
44

55
To use it:
66

@@ -12,6 +12,8 @@ Add as dependencies:
1212
* yoprogramo/QRcode_eSPI
1313
* bodmer/TFT_eSPI
1414

15+
You can configure in platformio.ini the data about hardware model and connections
16+
1517
## In arduino ide
1618

1719
Open Library Manager (menu Sketch > Include Library > Manage Libraries…) then install the following libraries:
@@ -20,15 +22,15 @@ Add as dependencies:
2022
* QRcode_eSPI
2123
* TFT_eSPI
2224

23-
Creating a QRcode is just as simple as:
25+
Create or update your user_setup to match your hardware specifications.
26+
27+
Creating a QRcode is just as simple as:
2428

2529
```
2630
2731
#include <SPI.h>
2832
#include <TFT_eSPI.h>
29-
#include <qrcode_eSPI.h>
30-
31-
#define TFTMODEL INITR_144GREENTAB
33+
#include <qrcode_espi.h>
3234
3335
TFT_eSPI display = TFT_eSPI();
3436
QRcode_eSPI qrcode (&display);
@@ -43,5 +45,6 @@ void setup() {
4345
}
4446
4547
```
48+
Main code provided by Ruslan Baybekov (https://github.com/oxyii)
4649

47-
For other displays, please refer the main repository: https://github.com/yoprogramo/QRcodeDisplay
50+
For other displays, please refer the main repository: https://github.com/yoprogramo/QRcodeDisplay

examples/simple.ino

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11

22
#include <SPI.h>
33
#include <TFT_eSPI.h>
4-
#include <qrcode_eSPI.h>
5-
6-
#define TFTMODEL INITR_144GREENTAB
4+
#include <qrcode_espi.h>
75

86
TFT_eSPI display = TFT_eSPI();
97
QRcode_eSPI qrcode (&display);
@@ -17,12 +15,12 @@ void setup() {
1715

1816
// enable debug qrcode
1917
// qrcode.debug();
20-
display.begin();
18+
display.init();
2119
// Initialize QRcode display using library
2220
qrcode.init();
2321
// create qrcode
2422
qrcode.create("Hello world.");
2523

2624
}
2725

28-
void loop() { }
26+
void loop() { }

library.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "QRcode_eSPI",
3-
"version": "1.0.0",
4-
"keywords": "qr code, ESP32, ESP8266, TFT, TFT_eSPI",
3+
"version": "1.0.1",
4+
"keywords": "qr code, ESP32, ESP8266, TFT, TFT eSPI",
55
"description": "QR code generation for TFT displays",
66
"repository":
77
{

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=QRcode_eSPI
2-
version=1.0.0
2+
version=1.0.1
33
author=Ruslan Baybekov (oxyii) and Jose Antonio Espinosa <yoprogramo@gmail.com>
44
maintainer=Jose Antonio Espinosa <yoprogramo@gmail.com>
55
sentence=QR code generation for TFT displays

src/qrcode_espi.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ void QRcode_eSPI::init() {
2121
offsetsY = (screenheight-(WD*multiply))/2;
2222
}
2323

24+
void QRcode_eSPI::create(String message) {
25+
display->startWrite();
26+
QRcodeDisplay::create(message);
27+
display->endWrite();
28+
}
29+
2430
void QRcode_eSPI::screenwhite() {
2531
display->fillScreen(TFT_WHITE);
2632
}

src/qrcode_espi.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class QRcode_eSPI : public QRcodeDisplay
1818
public:
1919

2020
QRcode_eSPI(TFT_eSPI *display);
21-
21+
void create(String message);
2222
void init();
2323
void screenwhite();
2424
void screenupdate();

0 commit comments

Comments
 (0)