Announcement

Collapse
No announcement yet.

help display Images

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

  • grm94
    replied


    Thank you very much Mark, the error was that I have to wait after tcdrain () but I still can not detect the ACK but that's not important, if I remove the line works. You're the best!

    Leave a comment:


  • ESPsupport
    replied


    Hmm, can't see anything obviously wrong, but of course my Unix is next to nothing.

    I wonder if
    tcdrain (fdComm);
    is working and working in the way one would expect it to, or if some manual sort of delay is required to ensure the output actually gets transmitted. If you can monitor the serial output in some way you should be able to 'prove' that it is working.

    Is
    if (fdComm < 0)
    correct? On Windows one would more normally use
    if (fdComm != 0)
    and I wonder if a negative valid value is possible on Unix (or at least some flavours of it)

    Leave a comment:


  • grm94
    replied


    the code used is the following link:
    http://4d.websitetoolbox.com/post/skypi-star-map-using-rpi-ulcd43pt-6391090

    the function is:

    void SetBaudrate(int Newrate){ struct termios serial_opts; WORD nBaud; if (fdComm < 0) return; // This is the only map from 4D Systems to Linux we support (for now) switch (Newrate) { case BAUD_110: nBaud = B110 ; break ; case BAUD_300: nBaud = B300 ; break ; case BAUD_600: nBaud = B600 ; break ; case BAUD_1200: nBaud = B1200 ; break ; case BAUD_2400: nBaud = B2400 ; break ; case BAUD_9600: nBaud = B9600 ; break ; case BAUD_19200: nBaud = B19200 ; break ; case BAUD_38400: nBaud = B38400 ; break ; case BAUD_57600: nBaud = B57600 ; break ; case BAUD_115200: nBaud = B115200 ; break ; default: nBaud = B9600 ; } // Current config tcgetattr(fdComm, &serial_opts); cfmakeraw(&serial_opts); cfsetospeed(&serial_opts, nBaud); cfsetispeed(&serial_opts, nBaud); // set new config tcsetattr(fdComm, TCSANOW, &serial_opts); return;}

    Leave a comment:


  • ESPsupport
    replied


    Not sure what you have done to get

    SetBaudrate (Newrate);

    to work on Linux, after all Newrate is going to be 13 for 115200 baud (check the doco) you need to have some of your own code in there that takes all the rates you want to support into account

    Leave a comment:


  • grm94
    replied
    Thank you very much Mark, Now I have another problem to change the baud rate because they never receive the ACK. The code is as follows: void setbaudWait (WORD Newrate) { towrite unsigned char [4]; towrite [0] = F_setbaudWait >> 8; towrite [1] = F_setbaudWait; towrite [2] = Newrate >> 8; towrite [3] = Newrate; WriteBytes (towrite, 4); SetThisBaudrate (Newrate) / / Change This systems baud rate to match new display rate, ACK is 100ms away printf ("wait for ACK \ n"); GetAck (); } SetThisBaudrate void (int Newrate) { if (fdComm <0) return; tcdrain (fdComm); SetBaudrate (Newrate); usleep (100000) / / Display sleeps for 100ms return; } I tried increasing the timeout in SetThisBaudrate function does not work. If I run my function several times about one of every 6 it works. I'm going crazy xD. Thanks for your time. Best regards.

    Leave a comment:


  • ESPsupport
    replied


    No, you need to convert your picture into the documented format then it can be displayed, that is what graphics composer does.

    The are a few unix utilities that almost do it, you will just need to add the header in front.

    Easier to use Graphics composer though, methinks

    Leave a comment:


  • grm94
    replied


    Thank you very much for your reply. I understand that part (storing the one as a DAT file) but my question was directed to be able to save an image in a bmp or png format type in the uSD card and then display it. Is this possible?

    Thanks again

    Leave a comment:


  • ESPsupport
    replied


    Well, that probably came from Q3 and 4 here http://4d.websitetoolbox.com/post/graphics-composer-and-the-display-modules-5438283

    Does that help?

    If not, just what is it that you need help with?

    Leave a comment:


  • grm94
    started a topic help display Images

    help display Images

    Hi all,

    I'm a little lost when displaying images in my uLCD43-PT, which is updated to the latest version of firmware Picaso SGC. I'm working on a linux platform, not Windows, with serial commands and would like to know how to keep them on the uSD display them in bmp or other proper formatting. I have read the forum but still can not clarify because there is no Graphic Composer in linux systems. I tried to draw pixel by pixel and it works but is not what I'm looking for my project and I read this: http://4d.websitetoolbox.com/post/loading-bmps-from-the-usd-card-without-graphicscomposer-5572341 but I still do not understand and would appreciate any help Best Regards Alexis
Working...
X