View previous topic :: View next topic |
Author |
Message |
superbrad
Joined: 18 Sep 2005 Posts: 62
|
Posted: Sat Mar 04, 2006 11:11 pm Post subject: |
|
|
OK, guys, here it is - the moment you've been waiting for - the code. Hopefully it's useful to somebody. The code is still a little buggy, but it works. I'm happy with it and will be using it the way it is and don't have 1.2 billion more hours to try and smooth out the rough edges until I have an actual application I'm going to put it into ...
That being said, here are (..ahem..) a few quid pro quo's...
- Remember that it might not work at all. After all, it was me that wrote it. Just a disclaimer .
- The bitmaps must have a pixel width divisible by 4. Bitmaps like to throw random bytes in to fill out a row until it's row width is divisible by four. I couldn't quite figure it out as there's no "official" datasheet that I could find out there on the Internet about the specifics.
- The bitmaps must be in 24 bit color. The program converts them on the fly to the appropriate format for the LCD screen. No, 256 color bitmaps aren't any faster code wise - you have to set up a color table and reference it. Spacewise, 256 colors would be more economical, but code wise I like 24 bits. Plus I get to put in any preferences on the color conversion algorithm.
- The subroutine is declared like this:
Sub Loadpic(byval Filename As String , Byval Startx As Byte , Byval Starty As Byte )
The filename is any 11 character bitmap filename on the MMC card, Startx and starty defines the starting pixel (bottom-left). Make sure StartX + Picture width < 130. I don't know what will happen if you start a picture that will go outside the screen borders, but I don't think it's a good idea to try it often.
I've tested using the subroutine to load more than one picture at a time. Theoretically, it should load as many as you can throw at it, but I haven't tested that yet.
I used Windows Paintbrush to save the pictures with, and IrfanView to view the pictures and also to look at the pictures in hex format. Neat little program.
Check the source code for pin assignments. The MMC uses hardware SPI, the LCD is bit-banged 9-bit serial SPI.
Images look pretty good, but actual pictures are a little ugly ... I'm sure someone with graphics expertise could crank out some pictures that look good, but I'm not a magician.
There you have it. Enjoy! Here are a couple of pictures from the LCD screen. Download the ZIP to get the source code and see several pictures side by side. |
|
Back to top |
|
|
bzijlstra
Joined: 30 Dec 2004 Posts: 1179 Location: Tilburg - Netherlands
|
Posted: Sun Mar 05, 2006 11:05 am Post subject: |
|
|
Hi Brad
Congratulations!!!! Code looks very nice. I will try this in the evening.
Have fun
Ben Zijlstra |
|
Back to top |
|
|
PeterK
Joined: 27 Jul 2005 Posts: 21
|
Posted: Wed May 10, 2006 12:28 pm Post subject: |
|
|
Hi,
you may get the displays at: www.display3000.com or directly at the shop at www.shop-en.display3000.com
There are also complete microcontroller / display solutions available.
There are complete Bascom subroutines included - where you just call these routines to draw bitmaps or lines etc. or if you want to write colored text to the screen.
Greetings
Peter |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum
|
|