How to transfer images from PC to Arduino via Ethernet display to LCD?

I am using the arduino mega 2560 and the ethernet w5100. I tried passing the array (int array) of the same image in PROGMEM, via UDP, or via the ajax web, using the drawbitmap () function of the UTFT library, but the image shows an error. Can I transfer images with an int array? Is it possible to transfer images via ethernet to arduino using tcp / udp? Help me please. Thank you. Sorry for my English not good.

My code:
myGLCD.drawBitmap (50, 50, 16, 1, tux, 1); ...
My tux[]:
8995 184 184 47288 32952 2 43192 47288 47288 47288 47288 47288 37048 37048 184 184
...

This is the English language section of the forum. Please post IN ENGLISH when posting here.

myGLCD.drawBitmap (50, 50, 16, 1, tux, 1); will draw a bitmap 16 pixels wide and 1 pixel high, at coordinates 50,50
Is that what you want?


myGLCD.drawBitmap (50, 50, 16, 1, tux, 1); sẽ vẽ một bitmap rộng 16 pixel và cao 1 pixel, tại tọa độ 50,50
Đó là điều bạn muốn?

Yes. My image is 16x16 pixels. I plan to draw 16 lines 1x16, but it does not display the correct image. Problem at drawbitmap function only used for PROGMEM?

PaulS:
This is the English language section of the forum. Please post IN ENGLISH when posting here.

Oh sorry. I have fixed it.

Yes.
Library code to display bitmap:

  ...
  for (tc=0; tc<(sx*sy); tc++)
  {
    col=pgm_read_word(&data[tc]);
    LCD_Write_DATA(col>>8,col & 0xff);
  }
  ...

Must use PROGMEM :frowning:


Vâng.
Mã thư viện để hiển thị bitmap:

  ...
  for (tc=0; tc<(sx*sy); tc++)
  {
    col=pgm_read_word(&data[tc]);
    LCD_Write_DATA(col>>8,col & 0xff);
  }
  ...

Phải sử dụng PROGMEM :frowning:

darrob:
Yes.
Library code to display bitmap:

  ...

for (tc=0; tc<(sx*sy); tc++)
  {
    col=pgm_read_word(&data[tc]);
    LCD_Write_DATA(col>>8,col & 0xff);
  }
  ...




Must use PROGMEM :(

****************************************

Vâng.
Mã thư viện để hiển thị bitmap:


...
  for (tc=0; tc<(sx*sy); tc++)
  {
    col=pgm_read_word(&data[tc]);
    LCD_Write_DATA(col>>8,col & 0xff);
  }
  ...




Phải sử dụng PROGMEM :(

Thank you. But I just want to draw bitmaps with arrays I create from data receivered via ethernet / udp, not from PROGMEM. Can i do it?

Can i do it?

Sure you can. But NOT by calling the library function which expects the data to be in PROGMEM. Copy that function, and make it access SRAM instead. That is NOT hard.

PaulS:
Sure you can. But NOT by calling the library function which expects the data to be in PROGMEM. Copy that function, and make it access SRAM instead. That is NOT hard.

Can you guide me? I really can not do it. I have searched for guides everywhere but have not seen them. Or can send images .RAW directly over TCP / UDP to SD in arduino then display to LCD?

Can you guide me?

It is REALLY simple.

    col=pgm_read_word(&data[tc]);
    LCD_Write_DATA(col>>8,col & 0xff);

The first line gets a word from PROGMEM, at the location specified by data[tc], and puts it in col.

You will have some array, in SRAM, where you store data. You will use

   col = someArray[tc];

The second line stays the same.

PaulS:
It is REALLY simple.

    col=pgm_read_word(&data[tc]);

LCD_Write_DATA(col>>8,col & 0xff);



The first line gets a word from PROGMEM, at the location specified by data[tc], and puts it in col.

You will have some array, in SRAM, where you store data. You will use


col = someArray[tc];




The second line stays the same.

Yeah I have done it. Thank you very much. I was able to transfer the image as a text array.
I want to ask more, can I transfer pictures directly through TCP / UDP? The SRAM memory is not enough, I intend to split the file into each packet sent, arduino will receive them and read the packet one by one, write to a file .RAW complete on SD, then display the image file on the LCD .
I'm having problems splitting the .RAW files and sending them and getting them? Can you help me?

can I transfer pictures directly through TCP / UDP?

You have my permission to do that. Data is data. It doesn't matter to the function that draw the bitmap how the data got there.

The SRAM memory is not enough

That's why bitmaps are usually stored in PROGMEM. You must have all the data on hand, whether in PROGMEM or SRAM, when you draw the bitmap, unless you re-write the code to draw only part of the bitmap at a time.

I'm having problems splitting the .RAW files and sending them and getting them? Can you help me?

No. "I'm having problems" is second only to "it doesn't work" in uselessness.

Specific issues we can help you with. General "I don't know how" means that jumped in the deep end of the pool in concrete shoes without a clue how to swim.

PaulS:
You have my permission to do that. Data is data. It doesn't matter to the function that draw the bitmap how the data got there.
That's why bitmaps are usually stored in PROGMEM. You must have all the data on hand, whether in PROGMEM or SRAM, when you draw the bitmap, unless you re-write the code to draw only part of the bitmap at a time.
No. "I'm having problems" is second only to "it doesn't work" in uselessness.

Specific issues we can help you with. General "I don't know how" means that jumped in the deep end of the pool in concrete shoes without a clue how to swim.

Yeppp "I do not know how" is correct. I have read about UDP libraries, web cilent of arduino, but only found it supports text transmission, ie char data type. it is very simple. I do not know when the RAW image is transmitted how it will be transmitted?

I have read about UDP libraries, web cilent of arduino, but only found it supports text transmission, ie char data type.

The libraries support sending bytes of data. Whether the bytes contain values that correspond to printable characters, or not, is irrelevant.

I do not know when the RAW image is transmitted how it will be transmitted?

Well, you are going to write the transmitter, or the code that gets the raw image data and puts it into the array that is going to be sent, so you really should know that.