• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login
M5Stack Community
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login

drawJpgFile / drawBmpFile

FAQS
4
30
126.8k
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.
  • R
    Richard
    last edited by Jun 20, 2018, 11:59 AM

    With Arduino IDE 1.8.5
    drawJpgFile / drawBmpFile don't work well.
    Images on display are pixelised
    Does anyone have a solution?

    J 1 Reply Last reply Jun 20, 2018, 2:52 PM Reply Quote 0
    • J
      JJ @Richard
      last edited by JJ Jun 20, 2018, 10:52 PM Jun 20, 2018, 2:52 PM

      @richard Hi Richard,

      Last time i tried, drawJpgFile worked fine with Arduino 1.8.5.

      Images need to be sized up to 330 x 240.

      1 Reply Last reply Reply Quote 0
      • R
        Richard
        last edited by Jun 20, 2018, 3:44 PM

        my jpg 320*240 on sd
        i have m5stack core 0.2.0
        don't work well0_1529509440380_20180620_174043.jpg

        1 Reply Last reply Reply Quote 0
        • C
          Calin
          last edited by Jun 20, 2018, 3:49 PM

          That problem is caused by SPI frequency.
          Try to lower the SPI frequency from TFT driver then it should work just fine.
          In most cases, 27Mhz SPI work just fine with most TFT's.

          1 Reply Last reply Reply Quote 0
          • R
            Richard
            last edited by Jun 20, 2018, 3:57 PM

            thanks, but I don't find this driver

            R 1 Reply Last reply Jun 20, 2018, 6:31 PM Reply Quote 0
            • R
              Richard @Richard
              last edited by Jun 20, 2018, 6:31 PM

              @richard
              I tried all the tft spi sd frequencies and I still have the problem!
              an idea?

              C 1 Reply Last reply Jun 20, 2018, 9:24 PM Reply Quote 0
              • C
                Calin @Richard
                last edited by Calin Jun 21, 2018, 5:27 AM Jun 20, 2018, 9:24 PM

                @richard The TFT SPI frequency is defined on In_eSPI_Setup.h file from M5Stack library at line 202: https://github.com/m5stack/M5Stack/blob/1772fd68743a7728e64ab6d24b931e1183599981/src/utility/In_eSPI_Setup.h#L202
                Try to set it to 27000000

                The SD SPI freqency can be different than TFT SPI frequency, since SD is on a different SPI bus.

                R 1 Reply Last reply Jun 21, 2018, 11:06 AM Reply Quote 0
                • R
                  Richard @Calin
                  last edited by Jun 21, 2018, 11:06 AM

                  @calin
                  thanks,
                  I tried but I still have the problem!
                  no idea

                  1 Reply Last reply Reply Quote 0
                  • C
                    Calin
                    last edited by Jun 21, 2018, 3:36 PM

                    Please share your code so i can check and see what's the problem there.

                    1 Reply Last reply Reply Quote 0
                    • R
                      Richard
                      last edited by Jun 21, 2018, 4:28 PM

                      my code

                      #include <M5Stack.h>

                      void setup(void) {

                      M5.begin();

                      M5.Lcd.setBrightness(200);
                      M5.Lcd.drawJpgFile(SD, "/corto.jpg"); // Load background from SD

                      //M5.Lcd.drawJpgFile(SD, "/corto_1.jpg", 0, 20, 300, 200);
                      // M5.Lcd.drawJpgFile(fs::FS &fs, const char *path, uint16_t x, uint16_t y, uint16_t maxWidth, uint16_t maxHeight, uint16_t offX, uint16_t offY, jpeg_div_t scale);
                      }

                      void loop() {

                      M5.update();
                      M5.Lcd.drawJpgFile(SD, "/corto.jpg");
                      delay(1000);
                      }
                      Thank you

                      1 Reply Last reply Reply Quote 0
                      • R
                        Richard
                        last edited by Jun 21, 2018, 4:34 PM

                        0_1529598838819_corto.jpg

                        1 Reply Last reply Reply Quote 0
                        • R
                          Richard
                          last edited by Jun 21, 2018, 4:42 PM

                          m5stack from m5stack store

                          1 Reply Last reply Reply Quote 0
                          • R
                            Richard
                            last edited by Jun 21, 2018, 4:44 PM

                            2017.6

                            1 Reply Last reply Reply Quote 0
                            • C
                              Calin
                              last edited by Jun 21, 2018, 7:56 PM

                              Here is the test using your code (with small modifications and relevant comments)
                              and standard m5Stack library from PlatformIO:
                              0_1529610830592_corso test.jpg

                              And here is the result:
                              0_1529610972829_corsotested.jpg

                              1 Reply Last reply Reply Quote 0
                              • R
                                Richard
                                last edited by Jun 21, 2018, 8:05 PM

                                fine, but does not work on ide arduino.
                                can you send me your code in espi setup?

                                1 Reply Last reply Reply Quote 0
                                • R
                                  Richard
                                  last edited by Jun 21, 2018, 8:15 PM

                                  do you have tested my with arduino ide?
                                  thank you

                                  C 1 Reply Last reply Jun 22, 2018, 4:31 PM Reply Quote 0
                                  • R
                                    Richard
                                    last edited by Jun 21, 2018, 9:50 PM

                                    i have install PlatformIO and load my projet:
                                    Wrote 230992 bytes (123957 compressed) at 0x00010000 in 11.0 seconds (effective 168.6 kbit/s)...
                                    Hash of data verified.

                                    Leaving...
                                    Hard resetting via RTS pin...
                                    ====================================================== [SUCCESS] Took 23.68 seconds =======================================
                                    I still have the problem!
                                    hardware problem?
                                    I

                                    1 Reply Last reply Reply Quote 0
                                    • ajb2k3A
                                      ajb2k3
                                      last edited by Jun 22, 2018, 5:13 AM

                                      Agreed, Following this myself and just get a blank screen with the image not loaded. This is my image 0_1529644400361_logo.jpg

                                      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
                                      • C
                                        Calin @Richard
                                        last edited by Jun 22, 2018, 4:31 PM

                                        @richard No. i didn't tested with arduino "ide". I uninstalled that from my PC because is mostly useless...

                                        I use Visual Studio, Eclipse or PlatformIO.

                                        I uploaded the PlatformIO project for your code to github: https://github.com/botofancalin/M5StackJpgtest
                                        The M5Stack library is already installed local into project.
                                        All you have to do is to download the repository and compile the code.

                                        ajb2k3A 1 Reply Last reply Jun 22, 2018, 5:10 PM Reply Quote 0
                                        • ajb2k3A
                                          ajb2k3 @Calin
                                          last edited by Jun 22, 2018, 5:10 PM

                                          @calin 在 drawJpgFile / drawBmpFile 中说:

                                          @richard No. i didn't tested with arduino "ide". I uninstalled that from my PC because is mostly useless...

                                          I use Visual Studio, Eclipse or PlatformIO.

                                          I uploaded the PlatformIO project for your code to github: https://github.com/botofancalin/M5StackJpgtest
                                          The M5Stack library is already installed local into project.
                                          All you have to do is to download the repository and compile the code.

                                          Maybe a stupid question (or two) but I'm going to ask anyway.
                                          Is there a hardware limitation for this i.e. is there a card size limit and a formatting requirement?
                                          Is there a specific image limitation for the image?

                                          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
                                          1 out of 30
                                          • First post
                                            1/30
                                            Last post