Avatar for Vivan

Vivan

Member since Nov 2021 • Last active Dec 2021
  • 2 conversations
  • 7 comments

Most recent activity

  • in Puck.js, Pixl.js and MDBT42
    Avatar for Vivan

    I thought the same as having searched the forums, I couldn't come across something similar. I ended up implementing a function that allowed me to provide an offset and length, allowing me to iterate through the directory structure in chunks. I realise it's very niche which is why I've not raised a PR for it. I appreciate the help and feedback, gave me the direction I needed to go in.

  • in Puck.js, Pixl.js and MDBT42
    Avatar for Vivan

    That's a good idea, some are images so they can definitely be stored in flash. Some are constructed from what I read from the SD Card though but they're relatively small. I've also re-written most of the JS to reuse pointers rather than creating new variables.

    I like the idea of using an iterator, I was thinking about adding offset parameters to readdir but I think returning and iterator would be better. I'll investigate. Also the ability to get a total count, but that should probably be a separate function call. I like that idea a lot.

  • in Puck.js, Pixl.js and MDBT42
    Avatar for Vivan

    I do have a lot of other code there and I've tried to use memory saving options where possible such as typed arrays. I'll update my functions to use objects also, but they mostly only have one parameter or two at most. Unfortunately the plan was to be able to read 150+ files in a directory at a later stage. Interestingly, saving files to flash and getting a list of them works fine.

    I'll try it with an empty puck.js and just the code to read the SD card and compare the memory profile to my full app.

  • in Puck.js, Pixl.js and MDBT42
    Avatar for Vivan

    Hi all,
    I've connected an SD Card via SPI to my Puck.js. I was hoping to get a full list of a directory (40+ files) and be able to iterate through them using a click. Unfortunately I get a low memory error when trying to read a directory. Is there any way to get a full directory listing? I don't mind recompiling firmware to make it happen.

  • in Projects
    Avatar for Vivan

    I figured it out thanks to your insight. I drew 3 squares of red blue and green and they were correct so I looked into the encoding of the image and it looks like that was the problem. I used this tool (http://www.rinkydinkelectronics.com/_t_d­oimageconverter565.php) to generate a RGB565 raw image and it worked perfectly. Thanks for the help!

  • in Projects
    Avatar for Vivan

    Sadly I've just arrived at work. Once I'm home I'll update with the images and the results of the drawing the shapes.

  • in Projects
    Avatar for Vivan

    Hi, hopefully someone can point me in the right direction.
    I've been working with a ST7789V LCD controlled by an NRF52832, I'm trying to draw images using LCD_SPI_UNBUF but unfortunately the colours always seem to be incorrect.
    So far I've set the the screen RGB mode using the 0x36 command and 0x8 but apart from that I'm struggling. I'm sending a raw image file directly to the lcd via SPI. The reds look nearly correct and I'm using a raw image file in a 16bpp RGB565 format. Is there something I'm missing, so far I'm unsure if it's the format of the image file or something I'm missing with the palette. I'm wondering if sending the raw image file directly to the LCD is in the incorrect format having looked at the datasheet but currently lack the hardware to test this. Any advice would be hugely appreciated!

    I'll add an image later today.

Actions