Hello. First and most importantly, I hope you liked the article! I have upgraded that now so it varies the temperature based on day length.
Anyway, no probs - these things seem complicated but once you get into them it becomes much easier.
I dont have Flowcode v3 installed on my machine so couldn't post a flowchart solution - the code I posted is pseudo-code, a made up language just to illustrate the code. A bitmap has an internal format - it isn't just a block of pixels, and requires information such as the width/height of the bitmap, bits-per-pixel, palette (if 8-bpp or under) and so on. After that 'header' there is the pixel data. To load any bitmap correctly you would need to look at this header and perform conversions - scaling if the resolution isnt right, colour conversion if your pixel depth (bpp) isnt right, and so on. We can probably assume as this is a specific bitmap that all this isnt necessary.
As part of that bitmap header there is an offset in the file to the pixels. This is the only thing you need to know really, and it needs reading out of the file. After this the pixels may be streamed from the file to the LCD.
The following images show how you might do this in Flowcode. It assumes you are using the FAT16 and gLCD components - if you are not then you need some way of accessing the card (via SPI, etc) and drawing to the LCD. I'm afraid I cant help here. It is the entire program, stored in 2 macros. You can then call the 'load_bitmap' call from Main or wherever you want.
Please note that this hasn't been tested properly - it is written in v5 which is still in development - but I hope it serves as an outline of what to do. Also, note that any variables in the images that start with a '.' are local variables - this is neater than a load of globals but isnt vital.
This image shows how to load from the FAT16 a 2-byte word. If you arn't using the FAT16 component, you can ignore this, but provide an alternative function for loading the data via SPI from your card, if necessary.
***** Note: There is a typo in the screenshot, '.ix <= 16' should be '.ix < 16' *****
- load_fat_word.png
- Load 16 bits with the FAT component
- (33.72 KiB) Downloaded 6846 times
This next image shows how this can be used to load the data off the card and sent to the LCD. Again, if you are not using these components you will have to provide your own calls.
- load_bitmap.png
- Loads a bitmap to the LCD
- (31.01 KiB) Downloaded 6846 times
Finally, here is an image of the macros and variables used. A 'B' next to a variable indicates it is a byte, a 'Z' indicates it is an integer. Any of the local variables can be created as globals if you like.
- summary.png
- Summary of the program
- (14.5 KiB) Downloaded 10983 times
Hopefully, thats about it. If any (or all) of this dosent make sense, lemme know, but otherwise good luck with it!
Jonny