#platform "uOLED-32028-PMD3T"
/*
4DGL Demo Application - Test for uSD_Image(x,y) - - for the following PICASO Platforms - - uOLED-32024-PMD3 - - uOLED-32024-PMD3T - - uOLED-32028-PMD3 - - uOLED-32028-PMD3T - - uLCD-320-PMD2 -
Requires Graphics Composer version 2.0.1.0
The image and video formats under 4DGL has changed slightly from the serial platform versions. The image height, width and colour_mode(colour bits per pixel) parameters are now embedded into the image data block and does not require the user to pass these parameters to the image/video display functions.
Getting Started: - Make sure to download the latest Graphics Composer version 2.0.1.0 - You'll need a SD card reader/writer. - Run the GC and create a new project. - Enable the following settings:
"Device" -> "Load Options" -> "Com Port/Drive" = (your drive name for the card reader, eg J:) "Device" -> "Load Options" -> "Write Command Block" = NO "Device" -> "Load Options" -> "Image Format" = Image & Pixel Data
- Change the properties of the display resolution to
X = 240, Y = 320
- On the left "Actions" window pane right click the mouse button and add the following images:
..\4DGL_Workshop_Version_a1.0\Images\Jpg\abstract_azo5onui.jpg" ..\4DGL_Workshop_Version_a1.0\Images\Jpg\aeon041114.jpg" ..\4DGL_Workshop_Version_a1.0\Jpg\hibiscus_hkowya9a.jpg" ..\4DGL_Workshop_Version_a1.0\Images\Jpg\seasunset_5umhrb4r.jpg" ..\4DGL_Workshop_Version_a1.0\Images\Jpg\strawberry_3db7f143.jpg" ..\4DGL_Workshop_Version_a1.0\Images\Jpg\sunset_q4l1iowt.jpg"
- Save your project, e.g ImageDemo1.gcs - Select "Device" -> "Load" to save all of the image data into the uSD card. - Using a text editor (eg Notepad) open the ImageDemo1.txt file the GC has created. Note down each of the sector addresses for each of the images. You will need these for the uSD_SetSector(SectHiWord, SectLoWord) function. In this case the sector addresses have already been inserted into the uSD_SetSector() function calls for each image for this example programas can be seen below.
*/
//------------------------------------------------------------------------------------------------------------------------------------------- func main() if(uSD_Init() == 0) // initialise and test the uSD card
print("PLEASE INSERT uSD CARD"); while(1);
endif
repeat
uSD_SetSector(0x0000, 0x1000); // set sector for image 1 ..\4DGL_Workshop_Version_a1.0\Images\Jpg\abstract_azo5onui.jpg" uSD_Image(0, 0); // display image 1 at x=0, y=0 pause(2000); // pause for 2 seconds
uSD_SetSector(0x0000, 0x112D); // set sector for image 2 ..\4DGL_Workshop_Version_a1.0\Images\Jpg\aeon041114.jpg" uSD_Image(0, 0); // display image 2 at x=0, y=0 pause(2000); // pause for 2 seconds
uSD_SetSector(0x0000, 0x125A); // set sector for image 3 ..\4DGL_Workshop_Version_a1.0\Jpg\hibiscus_hkowya9a.jpg" uSD_Image(0, 0); // display image 3 at x=0, y=0 pause(2000); // pause for 2 seconds
uSD_SetSector(0x0000, 0x1387); // set sector for image 4 ..\4DGL_Workshop_Version_a1.0\Images\Jpg\seasunset_5umhrb4r.jpg" uSD_Image(0, 0); // display image 4 at x=0, y=0 pause(2000); // pause for 2 seconds
uSD_SetSector(0x0000, 0x14B4); // set sector for image 5 ..\4DGL_Workshop_Version_a1.0\Images\Jpg\strawberry_3db7f143.jpg" uSD_Image(0, 0); // display image 5 at x=0, y=0 pause(2000); // pause for 2 seconds
uSD_SetSector(0x0000, 0x15E1); // set sector for image 6 ..\4DGL_Workshop_Version_a1.0\Images\Jpg\sunset_q4l1iowt.jpg" uSD_Image(0, 0); // display image 6 at x=0, y=0 pause(2000); // pause for 2 seconds
forever
endfunc //-------------------------------------------------------------------------------------------------------------------------------------------
|