SD card

43 views
Skip to first unread message

Zet Weeh

unread,
Aug 16, 2022, 9:50:01 AM8/16/22
to jallib
Hi 
Who can help me.
I have a picture on an oled. The data is in the jal-file.
I have a sd card working and I want to use it for the data of the picture.
How can I use the data on the sd card to get the picture on the oled?
I tried it making a buffer but I don't get it working.
Greetings,
Peter

Rob CJ

unread,
Aug 16, 2022, 12:51:47 PM8/16/22
to jal...@googlegroups.com
Hoi Peter,

As to undestand your question better.

The oled is capable of showing a picture from data in the PIC.

So you have a PIC with an SD card and you can read the data from the SD card, right?

And you want to copy that data to the Oled display. Which display is that?

Can you give some more info?

Thanks.

Kind regards,

Rob




Van: jal...@googlegroups.com <jal...@googlegroups.com> namens Zet Weeh <zet....@gmail.com>
Verzonden: dinsdag 16 augustus 2022 15:50
Aan: jallib <jal...@googlegroups.com>
Onderwerp: [jallib] SD card
 
--
You received this message because you are subscribed to the Google Groups "jallib" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jallib+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jallib/9e53d353-dd52-44e1-9aa8-a87950953d91n%40googlegroups.com.

Zet Weeh

unread,
Aug 16, 2022, 5:32:04 PM8/16/22
to jallib
Hi Rob
Yes. The oled 1306 shows the picture with the data in the program.
Yes I can read and write to the SD card.
Yes I want to copy the data from the SD card instead of using data in the program.
I will use the same oled 1306.
Greetings
Peter
Op dinsdag 16 augustus 2022 om 18:51:47 UTC+2 schreef rob...@hotmail.com:

Matthew Schinkel

unread,
Aug 16, 2022, 8:47:59 PM8/16/22
to jallib
Hi, please post your program so we can see what you have so far.

Does the sd card have fat32 on it?
What type of picture format is on the sd card?

I don't think anyone here has tried putting a .BMG .PNG or .JPG picture onto an lcd. If that is what your trying to do, you would have to understand the picture format. You may need to make your own picture format that can be easily put on the LCD.

Are you able to read and write to the sd card with jal?

Are you able to do basic things on the LCD like put a pixel, or draw a line?

In glcd_common.jal there is a function called glcd_draw_image(), but I don't know if your code can use that.

Thanks,
Matt.

Rob CJ

unread,
Aug 17, 2022, 12:57:30 PM8/17/22
to jal...@googlegroups.com
Hi Matt, Peter,

Last year I updated some graphics libraries and added a draw image function. I also created some sample files and I did convert some jpeg images to something that can be displayed.I  did this for the Nokia 5110 and for the SSD1306 display.  I added the info on how I created the data from the jpeg file to a format that the display understands to the sample files.  Below a copy of that from the sample file of the SSD1306:

-- Notes: A way to generate the image array from a png or jpg file:
--        *) Go to: http://javl.github.io/image2cpp/
--        *) Upload your png of jpg file
--        *) Canvas size: 128 x 64 or smaller, depending on your application
--        *) Background color: Black
--        *) Invert image colors: Yes (tick)
--        *) Scaling: scale to fit, keep proportions
--        *) Brightness: 128 or higher (what suits you best)
--        *) Code output format must be: Plain bytes
--        *) Draw mode must be: Vertical - 1 bit per pixel

So the picture data was in this case stored in program memory and showed on the display.

@peter. As Matt requested, can you send your program?

Thanks.

Kind regards,

Rob


Van: jal...@googlegroups.com <jal...@googlegroups.com> namens Matthew Schinkel <mattsc...@hotmail.com>
Verzonden: woensdag 17 augustus 2022 02:47
Aan: jallib <jal...@googlegroups.com>
Onderwerp: Re: [jallib] SD card
 

Zet Weeh

unread,
Aug 17, 2022, 4:24:19 PM8/17/22
to jallib
Hi Rob and Matt

Hoi Rob. I knew wat you wrote to format data for a screen of ssd1306. I did not send my program because I have no problem with my program. In the beginning I wrote that I dont know how to get the data from the sd and sent it to screen.
In the samples of Matt I see the possebility of byte by byte or a buffer of a whole segment of 512 byte.
And then sending it serial. But I want to send it to the screen and I don't know how to do this.
Must I send it byte for byte or buffer for buffer. So my question is: what is the code to get the data from the sd and on the screen.
Greetings Peter
Op woensdag 17 augustus 2022 om 18:57:30 UTC+2 schreef rob...@hotmail.com:

Matthew Schinkel

unread,
Aug 17, 2022, 4:30:30 PM8/17/22
to jallib
Are you able to get anything on the screen? What type of screen is it?

Matt.

Zet Weeh

unread,
Aug 17, 2022, 5:06:49 PM8/17/22
to jallib
The ssd1306 is an oled screen

Op woensdag 17 augustus 2022 om 22:30:30 UTC+2 schreef mattsc...@hotmail.com:

Rob CJ

unread,
Aug 18, 2022, 1:11:56 PM8/18/22
to jal...@googlegroups.com
Hi Peter,

You can send bytes to the screen byte by byte. But I stil do not understand what your set-up looks like.

I would imagine that it is a PIC, connected to an SD card (which interface does that use?) and connected to the SSD1306 by either SPI or IIC (which interface to do you use?) But then you write  "And then sending it serial". What are you sending serial? I read serial as USART but maybe you mean something else.

Kind regards,

Rob


Verzonden: woensdag 17 augustus 2022 23:06
Reply all
Reply to author
Forward
0 new messages