🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    QR Code positioning on M5Paper e-ink display

    Scheduled Pinned Locked Moved Arduino
    2 Posts 2 Posters 3.8k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • SkulblakaS Offline
      Skulblaka
      last edited by

      Hi everyone

      I'm having problem with positioning a QR code on my M5Paper e-ink screen.

      Given this very simple piece of Arduino code:

      #include <M5EPD.h>
      
      M5EPD_Canvas canvas(&M5.EPD);
      const uint16_t Y = 0;
      
      void setup()
      {
          M5.begin(false, false, false, false, false);
          M5.EPD.SetRotation(90);
          M5.EPD.Clear(true);
      
          canvas.createCanvas(540, 960);
          canvas.qrcode("https://www.example.org/", 70, Y, 400);
          canvas.pushCanvas(0, 0, UPDATE_MODE_GC16);
      }
      
      void loop()
      {
      }
      

      When setting Y to 0, the qr code gets placed at the very top of the screen, as expected:

      0_1633645361031_threema-20211008-002054235.jpg

      When setting Y to 560 (screen height 960 - size of qr code 400), I would expect the QR code to render at the very bottom of the screen. However, the qr code gets render barely a bit lower than with Y = 0.

      0_1633645516293_threema-20211008-002054788.jpg

      Is there something obvious I'm missing?
      Any help would be much appreciated.

      1 Reply Last reply Reply Quote 0
      • felmueF Offline
        felmue
        last edited by

        Hello @Skulblaka

        try using the x and y coordinates of the pushCanvas() command instead.

            canvas.qrcode("https://www.example.org/", 0, 0, 400);
            canvas.pushCanvas(70, Y, UPDATE_MODE_GC16);
        

        Thanks
        Felix

        GPIO translation table M5Stack / M5Core2
        Information about various M5Stack products.
        Code examples

        1 Reply Last reply Reply Quote 0

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        • First post
          Last post