Text or image?
dosmith
Posts: 15
I've been playing around with the VGA text demo file originally created by Chip Gracey in 2006 to create a device that we can use with our emergency notification system. The thought occurred to me that using a small graphic file might be easier than trying to do this in text. Anyone agree with that concept? If not, then I'm looking for someone to walk me through the code to edit parameters of the text including colors, size and background colors. Anyone interested? Thanks.
Comments
I take it that you need VGA output?
OBC
Is this what you are looking for? Or something more jazzy?
OBC
I'll await your good humor and response to potatohead's question.
OBC
Are you looking for a way to change/edit text with a keyboard?
I'm not sure font change is going to be available. I believe background color is doable with that object.
OBC
So we need some detail:
1. How many messages are there?
2. If only one or two, you can use a graphic. We have drivers that can change colors and such, and display simple bitmaps. 2 or 4 or 64 color bitmaps. Probably store only one 64 color one, a coupla 4 color ones, and maybe three 2 color ones. (and that's a rough guess based on a rough idea of content)
3. if more, then do you have storage on your board? SD card, or large EEPROM?
Based on that, we can give you some advice.
The storage method will require that a VGA driver is up, whatever communications you plan to use, and either SD or EEPROM driver code to be able to fetch the graphics.
If there are a lot of messages, then it's better to draw text, and there are some things that can be done. It won't be like your average graphics program can do with fonts and such, but you can make some adjustments. Each takes some work.
Since you said it's a emergency system, I suspect several, or perhaps some ad-hoc message to be displayed at emergency time...
With TV_Text you can choose one of 8 color-sets for every character. Such a color set defines fore- and background color.
Further you can change the palette which defines the 8 color sets, on the fly.
Here is a demo:
Andy
Seems like the Prop isn't doing much else but waiting to display it, which leaves lots of room for the image to be stored.
In my blog, I've linked the driver, and did some sample art. You get 64 colors to work from, and a resolution of 256x240 pixels to put it in. Many things, given there isn't a ton of detail, will easily fit into the HUB memory.
Your program then would just fire off that driver, two cogs only, no sprites are used, and when it's time to display the image, just write the tile-map address to the driver, so it will display.
The blog entry includes sprites. You can ignore those and just use the background.bmp as a working example of how to encode something for VGA display at a good resolution and color set.
The basic flow is author your message as a graphics .bmp file.
Then, save it.
Run the converter program Baggers wrote, and it will output two binary file packages. One will be all the unique tiles needed to display the image, and the other is a tilemap, which contains the screen addresses needed to tell the driver which tile to display where.
The sample program there contains the display code you will need.
This is one approach.
The other one is to use one of the VGA bitmap drivers, operate at a lower resolution, and simply author a bitmap in a graphics program to be displayed on the Propeller, skipping the tile map part of things.
http://forums.parallax.com/entry.php?76-Some-tile-art...
In that post, I've got the VGA / TV tile driver that does lots of colors. It's set for demoboard. Basically, you can make a 256x200 image for TV, then use the converter utility on it to generate tiles and a map file, which that driver can then display on the screen. The intent behind that is for games. I'm chipping away at one using the art sample on the blog. But, it doesn't have to be games. Look closely at the background.bmp It's formatted for VGA, as it has 240 lines. It can work on TV, just that not all of them will be seen.