Announcement

Collapse
No announcement yet.

How to load/display image from SD using only Arduino IDE?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • sarahspins
    started a topic How to load/display image from SD using only Arduino IDE?

    How to load/display image from SD using only Arduino IDE?

    I'm a mac user so not at all interested in figuring out how to run windows software, or spending $80 for said software when I'm not stupid and I know how to program in Arduino and I don't need a bullshit drag and drop interface... but HOW does one load an image from the SD card and display it using just the Arduino IDE? I have my board mostly the way I want it to function using basic shapes, but it would be great if I could use some graphic buttons in place of those ugly basic shapes, but I'm at a complete loss as far as how to do it, and there are ZERO examples available, anywhere, that don't use Workshop 4.

    Code snippets I've used before with other products (aka Adafruit) are not getting me anywhere, obviously.

    This not being readily available may very well be a complete dealbreaker, and I'll just send this back to Australia for a refund... or simply mail it back and file a paypal claim.

  • jlsogorb
    replied
    Originally posted by James_4DSystems View Post
    Sounds great. I'll check it. Thanks.

    Leave a comment:


  • James_4DSystems
    replied
    Hi jlsogorb

    See if this helps

    https://forum.4dsystems.com.au/forum...-cable-utility

    Regards

    Leave a comment:


  • jlsogorb
    replied
    Originally posted by James_4DSystems View Post
    My colleages created you a simple demo, I hope this helps.

    Instructions:

    1. Copy the files "arduino.dat" and "arduino.gci" to a FAT16-formatted uSD card. MUST be FAT16, not FAT32. These are the graphics files automatically generated by Workshop. If not using Workshop, these could be generated manually as per the link in the previous reply.
    2. Mount the uSD card to the 4Duino.
    3. Upload the sketch "arduino.ino" to the 4Duino. The 4Duino should now run and should display a red logo.

    .
    Hi James. I have a question. Is there any way to copy the files into SD card, without unmounting it. Could it be possible to access the card directly?
    Thanks.

    Leave a comment:


  • Joseph Herrera
    replied
    Hi Nico,

    I have attached 2 edited Arduino sketches operating at 9600 baud rate.

    'edited.ino' just shows the image created in the TETRIS2.dat and TETRIS2.gci.

    I also have inserted the Display.Callback functions in the setup().

    'edited_tetris.ino' shows the image then plays the tetris part.

    Might want to try SPE load the displays at 9600 first before increasing it at a higher baud rate to ensure reliablity.

    Hope this helps,
    Attached Files

    Leave a comment:


  • Nicomol
    replied
    Hello James,

    I'm a new user of 4D displays. I bought very recently a uLCD-43-PT, and I command it with an arduino mega2560.

    I'm trying to create my own version of tetris with all this stuff, and I'm quite close to succeed (well, still a few bugs to fix...). Anyway, I want now to load a picture at the beginning of my game, but my code doesn't work. I read a lot about this (all the notes), I studied the code you posted here and copied it, but when I uncomment the lines 118 to 132 in my program, I always have the message "drive not mounted".

    Do you have an idea of the nature of the problem, please ? The arduino code ? The dat and cgi files (created with visi) ? The uSDcard itself (It's FAT16, as required) ? Something else ?...

    Thanks a lot for your help.

    Nico

    Tetris2.rar

    Leave a comment:


  • James_4DSystems
    replied
    My colleages created you a simple demo, I hope this helps.

    Instructions:

    1. Copy the files "arduino.dat" and "arduino.gci" to a FAT16-formatted uSD card. MUST be FAT16, not FAT32. These are the graphics files automatically generated by Workshop. If not using Workshop, these could be generated manually as per the link in the previous reply.
    2. Mount the uSD card to the 4Duino.
    3. Upload the sketch "arduino.ino" to the 4Duino. The 4Duino should now run and should display a red logo.

    A very relevant application note for this is:

    Serial Arduino Displaying Images from the uSD Card FAT16
    http://www.4dsystems.com.au/appnote/4D-AN-00100/

    This app note however relies on the WYSIWYG area of the ViSi environment inside Workshop4 for creating the graphics files. The app note then shows the correct methods for displaying the images.

    I truly hope this helps.
    Attached Files

    Leave a comment:


  • James_4DSystems
    replied
    Picaso Internal 4DGL Functions are all the 4D Graphics Language functions which Picaso uses. On the 4Duino, it comes set up with SPE loaded in the Processor, which is a serial platform environment, so you dont have to program Picaso itself to get started with the 4Duino. To Program Picaso, you would need Workshop4, and since you are on a Mac and don't want to go there, then you can put this aside. It comes already loaded with SPE, so you just need to communicate to Picaso according to the SPE command set.

    So loaded on from factory in the Picaso processor, is SPE. On the 4duino product page, http://www.4dsystems.com.au/product/4Duino-24, it links a few documents. One is the Picaso Internal 4DGL Functions which you have already found, which is used if you are programming the Picaso from Workshop4 in an advanced way using the Designer or ViSi environments, which obviously you dont want to do. The other is the Picaso Serial Command Set, which is what you use to talk to the Picaso from a Host, in this case the atMega32U4 on the 4Duino. This is the one you want.
    http://www.4dsystems.com.au/productp...ual_R_1_20.pdf

    We have an Arduino library to talk to the Picaso, which is what is utilised inside Workshop4 also, and you can download it from our Github page. https://github.com/4dsystems/Picaso-...rduino-Library
    There are a couple of basic demos in there, which were written to show some of the commands in the serial command set, from Arduino to a Picaso display. 4Duino came later, but still operates the same way, and these demos can be made to work with 4Duino.

    If you want to show an image on the screen, then you need to make the graphics file in a suitable format for Picaso to read it, which there is a documented standard. Workshop4 does all this for you, but since you dont want to go down that path, you will have to do it manually. So what would have taken you seconds in Workshop4, will take you some time to understand and implement manually, however its possible. But you said you are a great programmer, so you should have no problem.

    http://forum.4dsystems.com.au/forum/...isplay-modules
    Refer to Q's 3 and 4.

    As it states and as you are aware, Workshop4 and 4D tools are all windows based, so if you dont want to install a VM to run it on your Mac, and you want to do it all from the Arduino IDE, then you have some steps to go through before it all 'just works' for you. Hence why Workshop4 was made, is encouraged and promoted for the 4Duino, its to make all this easier for you. This is where all the effort has gone for demos, rather than to go back 20 steps and implement it all manually.

    If you are really stuck and you want some images to be converted into the appropriate format and provided to you, all you need to do is ask. However the attitude, slagging off our software etc and then coming to ask for help, is no way to get started.

    Leave a comment:


  • sarahspins
    replied
    Unless there is some mythical documentation other than the 320 page "Picasso Internal 4DGL Functions", I don't know what else I could be looking at to figure this out. There are NO code examples I can find that do anything even remotely close to what I want to do, and it's not complicated. Just telling me "you will have to create the images yourself using the format required by Picaso" isn't helpful at all - what format does it even want, where do I get started, is there a tutorial somewhere? That document I just mentioned doesn't say anything, there are no functional examples that I can find if I want to simply display an image.

    Leave a comment:


  • James_4DSystems
    replied
    Hello,

    First off - whats with the hostilities on your first post??

    1) Workshop4 is Windows only as you know, and is stated in the doco which you would have seen before you purchased, but you can use the Arduino IDE but as stated it limits your functionality.
    2) Workshop4 Pro (the paid version) is not required for the 4Duino, it can be used but is not required unless you want to program the Picaso processor directly, so this is irrelevant for you. The free version of Workshop4 would do what you want anyway. Using our software would do what you want in a matter of seconds.
    3) Have you read the documentation on the Picaso processor, or are you only looking for examples?
    4) Loading the graphics onto uSD is documented on the forum, so if you want to do it without using WS4 then you will have to create the images yourself using the format required by Picaso.
    5) Obviously Adafruit code snippets are not going to work on a graphics processor not developed by Adafruit
    6) We have no desire to work with people with an attitude like yours, so either clean up the attitude and be professional, or send the product back and claim for a refund if that is the way you want to go. We have no time for people with attitudes like this.

    Good day

    Leave a comment:

Working...
X