esp8266_qrcode's People
Forkers
netpiemaker squix78 royglee doltry tackelua ishaq5niu guilhermaker tsaitsai danielliming anggun-indra jfdi-consulting 555learnwithme555 mike2nl olaclemmy irostom zhoudafeng jameschen00 ii0 tarcisiozf andreantivilo veamchile haustsu witsoft001 yushuiqiang w642833823 sramos30 mohamedmostafaa candelo yoprogramo bbigq-lyq sesacash-weather-project fotopretty schinckel ua6em rfolkker shakir-abdo makers-caveesp8266_qrcode's Issues
fatal error: OLEDDISPLAY.h No such file or directory
resize qr code follow display size
https://github.com/anunpanya/QRGenerate/blob/master/qrgenerate.cpp
See void render() and void createQR().
edit line 37
for (byte x = 0; x <WD; x + = 2) {.
to
for (byte x = 0; x <WD; x + = pxSize) {.
Trial sample files In order to understand
https://github.com/anunpanya/QRGenerate/blob/master/examples/example/example.ino
some suggestions
first of all, thanks for sharing your lib :)
I've noticed that encoding takes ~30ms on my ESP32 which lead to low FPS when using QRs with the SSD1306-lib UI methods
- added buffering of QR String to compare and skip encoding when unnecessary
- added direct calls to display->setPixelColor, instead of having an extra method for that
- removed display->display() call to avoid rendering twice
- removed the white background and replaced it by a 2px wide border around the QR
the QR isn't centered in my code as i want to display some text next to it, just wanted to share some ideas so you can take what you like of it.
my QRCode.h
#include "OLEDDisplay.h"
class QRcode
{
private:
String QRBuffer = "";
public:
void create(String message);
void render(OLEDDisplay *display, int x, int y);
void render(OLEDDisplay *display, String message, int x, int y){
create(message);
render(display, x, y);
}
};
my QRCode.cpp
#include <Arduino.h>
#include "qrcode.h"
#include "qrencode.h"
void QRcode::create(String message) {
// encoding takes ~30ms so we rather buffer the message on encoding and return if nothing changed
if(message.equals(QRBuffer))
return;
QRBuffer = message;
message.toCharArray((char *) strinbuf, 260);
qrencode();
}
void QRcode::render(OLEDDisplay *display, int x, int y) {
int offsetX = x + (display->height() - WD) / 2;
int offsetY = y + (display->height() - WD) / 2;
display->fillRect(offsetX - 2, offsetY - 2, WD + 4, WD + 4);
// print QR Code
for (byte x = 0; x < WD; x += 2) {
for (byte y = 0; y < WD; y++) {
if (QRBIT(x, y) && QRBIT((x + 1), y)) {
// black square on top of black square
display->setPixelColor(offsetX + x, offsetY + y, BLACK);
display->setPixelColor(offsetX + (x + 1), offsetY + y, BLACK);
}
if (!QRBIT(x, y) && QRBIT((x + 1), y)) {
// white square on top of black square
display->setPixelColor(offsetX + x, offsetY + y, WHITE);
display->setPixelColor(offsetX + (x + 1), offsetY + y, BLACK);
}
if (QRBIT(x, y) && !QRBIT((x + 1), y)) {
// black square on top of white square
display->setPixelColor(offsetX + x, offsetY + y, BLACK);
display->setPixelColor(offsetX + (x + 1), offsetY + y, WHITE);
}
if (!QRBIT(x, y) && !QRBIT((x + 1), y)) {
// white square on top of white square
display->setPixelColor(offsetX + x, offsetY + y, WHITE);
display->setPixelColor(offsetX + (x + 1), offsetY + y, WHITE);
}
}
}
//display->display(); //disabled that call within the class as it would double render frames with the UI
}
increase the size of the input data
hello,
first of all thank you for your library.
Is there a way to increase the amount of characters that can be encoded into the qr code?
Using the library with a SSD1306 screen 128x64 size, the input string is limited to 160 characters.
Is there a way to increase the input data lenght? or a larger display is needed?
Thank you
update qr code by mit app
how to code for update the qr by mit app? thanks before #11
QR doesn't render correctly without Serial.print()s in qrcode.cpp
Great library! Would be nice if I can use the serial output for something else.
Exporting the QR code generated as bitmap to be used on SPI TFT display
Hi Anunpanya,
I am currently using your library and would like to upgrade my screen to a 128*128 TFT SPI display. These displays are capable of displaying bitmap so I was wondering if your code can be made to dump out bitmap in a certain memory location of the esp8266 and then remap it to the TFT LCD screen. Really appreciate your great work here.
I plan to pair up your library with that of
sumotoy/TFT_ILI9163C
Warm Regards,
Terrence
would it be feasible to have a nodemcu version?
Hi, @anunpanya just see the project, very interesting. I just wonder would it be ok to have a nodemcu version written in lua?
QR code looks like a jumbled mess
Hi,
I am trying to print a QR code onto an SSD1306 128x64 display but I'm having some issues, the QR code is a jobbled mess. it doesn't look like a QR code at all. I am just using the base example code:
Code:
#include <qrcode.h>
#include <SSD1306.h>
SSD1306 display(0x3c, SDA, SCL);
QRcode qrcode (&display);
void setup() {
Serial.begin(115200);
Serial.println("");
Serial.println("Starting...");
display.init();
display.clear();
display.display();
// enable debug qrcode
// qrcode.debug();
// Initialize QRcode display using library
qrcode.init();
// create qrcode
qrcode.create("Hello world.");
}
void loop() { }
Here is the QR code:
https://imgur.com/a/WMiXy87
Thanks all!
Generate WIFI qr code
Hello,
Is it possible to generate a wifi QR cocde ?
and what string should we write in qrcode.create
thanks a lot for the librarie
Using different QR version
Hi!
Is it possible to use a lower version of QR code? With lower resolution/memory
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.