Pages: [1]   Go Down
Author Topic: include .c file (using "extern unsigned int file") from SD card  (Read 824 times)
0 Members and 1 Guest are viewing this topic.
Localhost 127.0.0.1, World Wide Web
Offline Offline
Newbie
*
Karma: 0
Posts: 34
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Is it possible to include .c file to project by reading it from SD card module?

PS: I'm trying to display 320x240 image on 320x240 TFT display module by using UTFT library. But the image file converted to .c using ImageConverter 565 is too large. It has 153 600 bytes and ATMega can only hold 126 976 bytes. That's why I'm asking if I can do this smiley. In the first picture you can see my code and how I mean "to include".

Picture 1:
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 613
Posts: 49343
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Is it possible to include .c file to project by reading it from SD card module?
No. The compiler runs on the PC before the hex file is uploaded to the Arduino. The hex file knows nothing about where the bits came from.

Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 208
Posts: 8853
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You can store the image as a bitmap on an SD card but you will then have to write a loop to read the image in a small piece (512 bytes?) at a time an draw each piece to your screen.  I'm sure someone has done this before.
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Pages: [1]   Go Up
Jump to: