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

    How to display picture

    Arduino
    4
    5
    13.7k
    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.
    • P
      Powersoft
      last edited by

      Hello,

      How do I display a picture to the screen (M5Stack) from the SD-Card.
      I'm looking for an example.
      Thanks for any help.

      Cheers,
      Jan

      ajb2k3A K 2 Replies Last reply Reply Quote 0
      • ajb2k3A
        ajb2k3 @Powersoft
        last edited by

        @powersoft said in How to display picture:

        Hello,

        How do I display a picture to the screen (M5Stack) from the SD-Card.
        I'm looking for an example.
        Thanks for any help.

        Cheers,
        Jan

        In what programming language?

        UIFlow, so easy an adult can learn it!
        If I don't know it, be patient!
        I've ether not learned it or am too drunk to remember it!
        Author of the WIP UIFlow Handbook!
        M5Black, Go, Stick, Core2, and so much more it cant be fit in here!

        1 Reply Last reply Reply Quote 0
        • P
          Powersoft
          last edited by

          I use the arduino envoirment.

          1 Reply Last reply Reply Quote 0
          • lukasmaximusL
            lukasmaximus
            last edited by

            Hey @Powersoft you can try this tutorial which @Dimi wrote some time ago on our forums, I believe the information should still be relevant http://forum.m5stack.com/topic/49/lesson-1-2-1-lcd-how-to-create-image-array/2

            1 Reply Last reply Reply Quote 0
            • K
              kosternet @Powersoft
              last edited by

              @powersoft Maybe you find it interesting to know that there is a way of compiling a picture into your code so that you do not need an SD-card. This could make your solution more simple.

              To do:

              Download the UTFT-library from Rinky Dink Electronics (http://www.rinkydinkelectronics.com/library.php?id=51)
              Extract the download and use the Tools\Imageconverter565.exe to convert the image to a .c file (select AVR board)
              Open the .c file and change the line '#include <avr/pgmspace.h>' into '#include<pgmspace.h>'
              Insert the following lines in the file (the values should be the same as the image, 320x240 is max for M5Stack):
              const uint16_t imageWidth = 320;
              const uint16_t imageHeight = 240;
              Rename the .c file into .h (e.g. logo.c into logo.h) and place the file in the folder where the .ino-file for your project is
              In your Arduino-program add the following line in the top (or the other filename you have chosen)
              #include <M5Stack.h>
              #include "logo.h"
              In your Arduino-program add the following line in the 'setup'-function:
              M5.Lcd.setSwapBytes(true);
              In your Arduino-program add the following line in the place where you want to show the image:
              M5.Lcd.pushImage(0, 0, logoWidth, logoHeight, logo);

              I have included a link to a small demo-file on the following page:
              https://info.kosternet.nl/doku.php?id=publiek:m5stack

              1 Reply Last reply Reply Quote 0
              • First post
                Last post