Digole
Digital Solutions
iDigole Buyer ProtectioniDigole Buyer
Protection
My shopping cart
0 Items:
Secure Checkout
Top Rated Plus
Visit Our Live Auctions
99.9% Customer's Satisfaction
Search store:
 
Forum : Digole Serial Display :

 Search Forum.. 
 Creat New Topic   Reply 

How can i display an image

Hello everyone,

before, sorry for my english, i'm français...

my problem is :

I want to display an image, i've convert image to c with the tool in your website.

I tried this code:

 

//You have to change the following setting according to the Digole display


#define _Digole_Serial_I2C_  //To tell compiler compile the special communication only, 

#define FLASH_CHIP    //if the module equipt with 2MB or 4MB flash chip, use it, otherwise  use // to disable it

//#define Ver 34           //if the version of firmware on display is V3.3 and newer, use it

//all available are:_Digole_Serial_UART_, _Digole_Serial_I2C_ and _Digole_Serial_SPI_

#define MONO  //if the screen panel is monochrome


//end changing


//define 8 bit color, see:https://en.wikipedia.org/wiki/8-bit_color

#define WHITE 0xFF

#define BLACK 0



#include <DigoleSerial.h>

//--------UART setup

#if defined(_Digole_Serial_UART_)

DigoleSerialDisp mydisp(&Serial, 38400); //UART:Arduino UNO: Pin 1(TX)on arduino to RX on module

#endif

//--------I2C setup

#if defined(_Digole_Serial_I2C_)

#include <Wire.h>

DigoleSerialDisp mydisp(&Wire, '\x27'); //I2C:Arduino UNO: SDA (data line) is on analog input pin 4, and SCL (clock line) is on analog input pin 5 on UNO and Duemilanove

#endif

//--------SPI setup

#if defined(_Digole_Serial_SPI_)

DigoleSerialDisp mydisp(8, 9, 10, 11); //SPI:Pin 8: data, 9:clock, 10: SS, 11:SI. you can assign 255 to SS, and hard ground SS pin on module

#endif


const unsigned char commandset[] PROGMEM = "CLSF\x12TP\x03\x0F ESC\xf0\xc0\xffTTRun Command set in Flash Memory\n\r\x00SC\xff TTHELLO\x00\xff";


const unsigned char welOld[] PROGMEM = {

           'C', 'L', //clear screen

         'G', 'P', 0, 0,  //set display position at 0,0

         'D', 'I', 'M', 128, 64,  //draw a 128x64 mono image, following is 128x64 standard image data, can be used on any Digole serial modules

255,255,255,255,255

,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255

,248,0,0,0,0,0,7,255,255,224,0,0,0,0,0,63

,248,0,0,0,0,127,255,255,255,255,255,0,0,0,0,31

,248,0,0,0,127,255,255,255,255,255,255,255,0,0,0,31

,248,0,0,63,255,255,255,255,255,255,255,255,252,0,0,31

,248,0,7,255,255,255,255,255,255,255,255,255,255,224,0,31

,248,0,127,255,255,255,255,255,255,255,255,255,255,254,0,31

,248,3,255,255,255,255,255,255,255,255,255,255,255,255,192,31

,248,31,255,255,255,255,255,255,255,255,255,255,255,255,240,31

,248,127,255,255,255,255,255,255,255,255,255,255,255,255,254,31

,249,255,255,255,255,255,255,255,255,255,255,255,255,255,255,159

,251,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255

,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255

,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255

,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255

,248,15,255,255,255,255,255,255,255,255,255,255,255,255,248,63

,248,3,255,192,0,7,255,255,255,255,224,0,7,255,192,63

,248,3,248,0,0,0,63,255,255,252,0,0,0,63,192,63

,255,1,192,63,248,0,7,255,255,224,0,31,252,3,192,255

,248,1,131,255,255,128,0,31,248,0,1,255,255,193,128,63

,248,1,255,255,255,240,0,7,224,0,15,255,255,255,0,63

,255,128,255,255,255,254,0,15,240,0,127,255,255,255,129,255

,248,15,255,255,255,255,224,63,248,7,255,255,255,191,240,63

,248,255,227,255,248,31,255,255,255,255,240,31,255,199,255,63

,255,255,135,254,0,0,255,255,255,254,0,0,255,227,255,255

,255,255,143,248,0,0,31,255,255,248,0,0,31,227,255,255

,255,255,199,240,0,0,15,231,243,240,0,0,15,231,255,255

,255,255,255,224,0,0,63,231,243,252,0,0,7,255,255,255

,255,255,254,31,255,240,127,199,241,254,15,255,240,127,255,255

,255,255,255,255,255,255,159,143,248,249,255,255,255,255,255,255

,255,255,255,255,255,255,252,63,254,31,255,255,255,255,255,255

,255,255,227,255,255,255,227,255,255,227,255,255,255,199,255,255

,255,254,7,255,255,255,207,255,255,248,255,255,255,224,255,255

,255,248,15,255,255,255,143,255,255,248,255,255,255,240,31,255

,255,224,15,255,255,255,207,255,255,249,255,255,255,240,7,255

,255,192,15,255,255,252,0,255,254,0,31,255,255,224,3,255

,255,128,3,255,254,0,0,63,240,0,0,127,255,192,1,255

,255,0,0,0,0,0,0,0,0,0,0,1,224,0,1,255

,255,0,0,0,0,0,0,0,0,0,0,0,0,0,1,255

,255,128,0,0,0,0,0,0,0,0,0,0,0,0,3,255

,251,192,0,0,0,0,0,0,0,0,0,0,0,0,7,223

,248,224,0,0,0,0,0,0,0,0,0,0,0,0,31,31

,248,60,0,0,0,0,0,0,0,0,0,0,0,0,120,31

,248,15,192,0,0,0,0,0,0,12,0,0,0,7,240,31

,248,3,255,255,254,0,15,255,255,240,0,127,255,255,192,31

,248,1,255,255,255,0,0,0,0,0,0,255,255,255,128,31

,248,0,255,255,255,224,0,0,0,0,3,255,255,255,0,31

,248,0,127,255,255,252,0,0,0,0,63,255,255,254,0,31

,248,0,127,255,255,255,224,0,0,7,255,255,255,254,0,31

,248,0,127,255,255,255,255,248,127,255,255,255,255,252,0,31

,248,0,63,255,255,255,255,255,255,255,255,255,255,252,0,31

,248,0,31,255,255,255,255,255,255,255,255,255,255,248,0,31

,248,0,15,255,255,255,255,255,255,255,255,255,255,240,0,31

,248,0,7,255,255,255,255,255,255,255,255,255,255,224,0,31

,248,0,1,255,255,255,255,255,255,255,255,255,255,192,0,31

,248,0,0,127,255,255,255,255,255,255,255,255,255,0,0,31

,248,0,0,15,255,255,255,255,255,255,255,255,248,0,0,31

,248,0,0,3,255,255,255,255,255,255,255,255,192,0,0,31

,248,0,0,0,127,255,255,255,255,255,255,254,0,0,0,31

,248,0,0,0,15,255,255,255,255,255,255,224,0,0,0,31

,248,0,0,0,1,255,255,255,255,255,255,128,0,0,0,63

,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255

,255,255,255,255,255,255,255,

 'S','C',1,  //set color white

'T', 'P', 0, 0,  //set text position at 0,0

        255,255 //255 is indicate of ending this command set



};



void delay1(void) //for demo use, reset display position and clean the demo line

{

  delay(3000); //delay 1.5 seconds

  mydisp.setColor(WHITE);

}

void setup() {

  mydisp.begin(); //initiate serial port

  mydisp.disableCursor(); //disable cursor, enable cursore use: enableCursor();

  mydisp.setBgColor(BLACK); //set another back ground color

  mydisp.displayStartScreen(0);

#if Ver>32||defined(FLASH_CHIP)

  delay1();

  afficherDessin();

#endif

}


void loop() {

  // put your main code here, to run repeatedly:


}

void afficherDessin(void)

{

#ifdef FLASH_CHIP

#define comAddress 400000 //this address is in flash chip

#else

#define comAddress 2048 //this address is in MCU interal

#endif

  mydisp.cleanDrawWindow();

  mydisp.drawStr(0, 0, "BONJOUR");

  delay(1500); //wait a movement

  mydisp.cleanDrawWindow();

  mydisp.print("\nTAMAJURAMS\n\r");

  mydisp.cleanDrawWindow();

  delay(1500); //wait a movement


    //delay1();

   //mydisp.resetDrawWindow();

   //mydisp.cleanDrawWindow(); 

   //mydisp.clearScreen(); //CLear screen

   delay(1500); //wait a movement

   mydisp.downloadStartScreen(1024, welOld);


  delay(3000);

 

With this code i can see my picture but just the beginin of it and after we have the logo (welcome): 

 

 

 

 

 

 www.noelshack.com/2019-04-4-1548349643-img-20190124-180233.jpg

 

Do you know where is the problem ? Memory maybe ?

 

Thanks

RE:How can i display an image

         'G', 'P', 0, 0,  //set display position at 0,0

         'D', 'I', 'M', 128, 64,  //draw a 128x64 mono image, following is 128x64 standard image data, can be used on any Digole 

above code is special for commands set (move top-left coordinates out from "DIM"), if you want to display image via serial, you need move top-left coordinates in "DIM", like this:

'D','I','M',0,0,128,64,

image data......

Do you know why we designed like this?

Because you can reuse the image data in flash and display it at any position on the screen by using "GP" command.

RE:How can i display an image

 Thanks for your return,

 

I know we can save and display image when we want but

I confess that i don't understand everythink.

I read the documentation but my english is not the best, so i've trouble to understand everythink.

 

I would like to have an exemple for how "save" in flash an image

and display it.

Because i'm a little lost ...

thank you.

 

RE:How can i display an image

Someone can give me an example for load and display image in memory ? 

Thanks

RE:How can i display an image

See the sample at the top-left potion on the page of online emulator:

https://www.digole.com/tools/digole-emu.php

Click "Splash and Commands set", you should save image as commands set in flash memory

Copyright Digole Digital Solutions, 2008-2021. All rights reserved.
Powered by Victor Sun