Giter Site home page Giter Site logo

esp8266_qrcode's People

Contributors

anunpanya avatar ben-mkiv avatar per1234 avatar squix78 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

esp8266_qrcode's Issues

fatal error: OLEDDISPLAY.h No such file or directory

image
Hi, I am new to Arduino, I came across this issue while running the example coding provided, it says no such file or directory, OLEDDISPLAY.h exist in the qrcode.h, is it my problem? I installed the library via Arduino IDE's library manager, am I not installing it properly?

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

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

ili9163display

Warm Regards,
Terrence

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.