1

In my new project based CPP on microcontroller,

I have Text as image row and column stored in W25Q32 memory. the width of image can vary but height is fixed. So if Image width is 32 bits wide first 4 bytes will be Row1 and next 4 bytes will be Row2 etc. I cant read whole bytes into ram because width can go up to 12,800.

My LED Matrix Display area width and height is fixed. Can someone help me how implement a function to scroll text image from left to right on the Display area. I am burning my head for two days.

joshin joy
  • 11
  • 1
  • Any function for scrolling images would probably depend rather heavily on how you're currently displaying static images. Can you provide more information about what you have working so far? – Dave Tweed Jul 06 '23 at 09:55
  • For static image every thing is straight forward. for static image the width and height is fixed. so i read the data from the memory and fill a ram buffer Display[height][width]. then use it for display and this buffer will max upto Display[64][192/8]. but for move left the width may be very high so i cant use to fill the buffer. – joshin joy Jul 06 '23 at 10:31
  • Then you just need a function that reads only part of the image data into your display buffer in RAM, starting at an arbitrary offset into the flash memory. To scroll horizontally, you simply adjust the offset by one column's worth of data and call the function again. – Dave Tweed Jul 06 '23 at 10:39
  • My suggestion would be to store your image in the other direction: if the height is 16 bits, store the first *column* in the first two bytes, second column in next two bytes, etc. Then to start from a given column N of the image, you start with an offset into the image array. Depending on your data structures, that might be as simple as `&image[n]`. – jonathanjo Jul 06 '23 at 10:51
  • @jonathanjo thank you, i don't know why i didn't think like that. your answer gave me some light. i will surely try like that – joshin joy Jul 06 '23 at 12:45

0 Answers0