Forum Software Ferduino code Image RAW to Ferduino Code

Image RAW to Ferduino Code  [SOLVED]


Post Number:#1 Post Thu Jun 23, 2016 12:04 am
Posts: 69
Topics: 18
Images: 2
Solve rating: 1
Joined: Tue Apr 14, 2015 11:54 pm
Topics: 18
Age: 42
Gender: Male
National Flag:
Indonesia
fernando halo, can be given arduino code with image, with an extension of RAW.
I'm trying to practice arduino code to change the look of the display home with the image.


I tried it in the library added
"UTFT_SdRaw" library

in ferduino tab
// File system object
SdFat sd;
const byte ChipSelect = 53; // For TFT Shield
UTFT_SdRaw MyFiles (& myGLCD);


try to load a picture in the tab ferduino
// Draw home icon
   myFiles.load (0, 254, 240, 66, "filexxx.raw", 4);


but still errors

thanks

Post Number:#2 Post Thu Jun 23, 2016 11:20 am
Posts: 1699
Topics: 38
Images: 301
Solve rating: 233
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 39
Location: São Paulo
Gender: Male
National Flag:
Brazil

Hi!

I don't know this library, try this library called "UTFT_SdFat".

In Ferduino tab add only this lines:

#include "UTFT_SdFat.h"
UTFT_SdFat myFiles(&myGLCD);


Use this line to show the image:

myFiles.loadBitmap(26, 80, 188, 72, "image.raw");


BTW: When ask help about something show me the errors because I haven't a crystal ball.

Best regards.
Post your doubts on forum because it can help another user too. Just PM me for support if it's absolutely necessary.

Post Number:#3 Post Fri Jun 24, 2016 7:25 am
Posts: 101
Topics: 22
Solve rating: 0
Joined: Wed Sep 10, 2014 7:07 pm
Topics: 22
Age: 49
Gender: None specified
National Flag:
Italy
hello Fernando

I tried to use this library to display the images in .raw format, but the image is not displayed

this is the code I used

how to use the sd card integrated in the TFT display

I copied prova.raw image files with one resolution 150 * 150

in Ferduino TAB
#include <UTFT_SdFat.h>


onst byte SD_CARD = 0;
const byte ETHER_CARD = 1;
const byte RFM = 2;
const byte ChipSelect_SD = 53;           
const byte SelectSlave_ETH = 4;
const int ChipSelect_RFM = A15;


UTFT        myGLCD(ITDB32WD, 38,39,40,41);   //"X" é o modelo do LCD
UTouch      myTouch(6,5,4,3,2);
//UTouch      myTouch(7,6,5,4,3);
UTFT_SdFat myFiles(&myGLCD);


tab inicio

myFiles.loadBitmap (251, 95, 150, 150, "prova.raw" ,1 );


but I see nothing

thank you

Post Number:#4 Post Fri Jun 24, 2016 1:04 pm
Posts: 1699
Topics: 38
Images: 301
Solve rating: 233
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 39
Location: São Paulo
Gender: Male
National Flag:
Brazil

Hi!

Try to make it work with example called "Load_image.ino" available in library folder.

If you have problem try "SPI_HALF_SPEED" or "SPI_QUARTER_SPEED" instead "SPI_FULL_SPEED"

Here a test I did using the image "TEST.RAW".

Image


I won't test with Ferduino code because I don't want change my libraries folder for it.

Best regards.
Post your doubts on forum because it can help another user too. Just PM me for support if it's absolutely necessary.

Post Number:#5 Post Fri Jun 24, 2016 2:47 pm
Posts: 101
Topics: 22
Solve rating: 0
Joined: Wed Sep 10, 2014 7:07 pm
Topics: 22
Age: 49
Gender: None specified
National Flag:
Italy
I did the test that you suggested and loaded the example "Load_image.ino" works fine

I tried to add in ferduino code but does not load the wallaper

maybe I can not understand on what tab I have to write different code strings

Post Number:#6 Post Sat Jun 25, 2016 12:42 pm
Posts: 1699
Topics: 38
Images: 301
Solve rating: 233
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 39
Location: São Paulo
Gender: Male
National Flag:
Brazil

Hi!

It worked to me.

Ferduino tab:

Image


Image


L_Menu tab:

Image


Result:

Image


I'm using images from iAqua avalaible here.

Best regards.
Post your doubts on forum because it can help another user too. Just PM me for support if it's absolutely necessary.

Post Number:#7 Post Sat Jun 25, 2016 2:19 pm
Posts: 101
Topics: 22
Solve rating: 0
Joined: Wed Sep 10, 2014 7:07 pm
Topics: 22
Age: 49
Gender: None specified
National Flag:
Italy
I could not read the sd I added this code and it worked

in tab setup

myfile.begin(ChipSelect_SD, SPI_FULL_SPEED);


in tab ferduino

SdFat myfile;


now it works fine
thank you

I need more help
I wrote the code to display the images of the moon phase by loading them in the code in .c

in tab moonPhase

if ((AG >= 0) && (AG <= 1.85))         // 0 a 12.5%       
  {
    LP = tabela_textos_fase[1];         // "LUNA NUOVA"
    MoonPic = New_Moon;   
  }
  if ((AG > 1,85) && (AG <= 5.54))       //12.5% a 35.5% 
  {
    LP = tabela_textos_fase[2];        // "LUNA CRESCENTE"
    MoonPic = Waxing_Crescent;
  }
  if ((AG > 5.54) && (AG <= 9.23))     //  37.5 A 62.5%
  {
    LP = "   PRIMO QUARTO";               // "PRIMO QUARTO"
    MoonPic = First_Quarter;
  }
  if ((AG > 9.23) && (AG <= 12.92))    //  62.5 A 87.5%
  {
    LP = "GIBBOSA CRESCENTE";          //GIBBOSA CRESCENTE
    MoonPic = Waxing_Gibbous;
  }
  if ((AG > 12.92) && (AG <= 16.61))      // 87,5 a 100 e da 100 a 87.5%     
  {
    LP = tabela_textos_fase[3];         // "LUNA PIENA"
    MoonPic = Full_Moon;
  }
  if ((AG > 16.61) && (AG <= 20.30))   // 87.5 A 62.5%
  {
    LP = " GIBBOSA CALANTE";             // GIBBOSA CALANTE
    MoonPic = Waning_Gibbous;
  }
  if ((AG > 20.30) && (AG <= 23.99))    //62.5 A 35.5%
  {
    LP = "  ULTIMO QUARTO";             //ULTIMO QUARTO
    MoonPic = Last_Quarter;
  }
  if ((AG > 23.99) && (AG <= 27.68))     // 37,5 a 12,5%   
  {
    LP = tabela_textos_fase[4];         // "LUNA CALANTE"
    MoonPic = Waning_Crescent;
  }
  if ((AG >= 27.68) && (AG <= LC))       //12.5 a 0%
  {
    LP = tabela_textos_fase[1];         // "LUNA NUOVA"
    MoonPic = New_Moon;
  }

  return phase;



in tab ferduino

unsigned int *MoonPic;             
extern unsigned int                 
  New_Moon[0xD24],
  Waxing_Crescent[0xD24],
  First_Quarter[0xD24],
  Waxing_Gibbous[0xD24],
  Full_Moon[0xD24],
  Waning_Gibbous[0xD24],
  Last_Quarter[0xD24],
  Waning_Crescent[0xD24];


in this way it works fine
but I would like to load from sd pictures with the library UTFT_SdFat in order to free up space on the Arduino memory
but I can not get it to work you will give me a help?

Post Number:#8 Post Sat Jun 25, 2016 6:05 pm
Posts: 1699
Topics: 38
Images: 301
Solve rating: 233
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 39
Location: São Paulo
Gender: Male
National Flag:
Brazil

This lines of code are not needed to my latest version of Ferduino.

Take the image and convert to .RAW using this online tool so use the code above to load the images.
Post your doubts on forum because it can help another user too. Just PM me for support if it's absolutely necessary.

Post Number:#9 Post Sun Jun 26, 2016 5:26 am
Posts: 101
Topics: 22
Solve rating: 0
Joined: Wed Sep 10, 2014 7:07 pm
Topics: 22
Age: 49
Gender: None specified
National Flag:
Italy
yes thank you to convert images in RAW I know him

but if I write me error code I do not understand where I'm wrong

ferduino tab

unsigned int *MoonPic;               //Pointer to the Lunar Phase Pics
extern unsigned int                 //Lunar Phase Pics
  New_Moon[0xD24] = myFiles.loadBitmap(7, 80, 200, 60, "newmoon.raw");


I can not figure out how to call up the image using pointer

Post Number:#10 Post Sun Jun 26, 2016 8:40 am
Posts: 101
Topics: 22
Solve rating: 0
Joined: Wed Sep 10, 2014 7:07 pm
Topics: 22
Age: 49
Gender: None specified
National Flag:
Italy
yes thank you to convert images in RAW I know him

but if I write me error code I do not understand where I'm wrong

ferduino tab

unsigned int *MoonPic;               //Pointer to the Lunar Phase Pics
extern unsigned int                 //Lunar Phase Pics
  New_Moon[0xD24] = myFiles.loadBitmap(7, 80, 200, 60, "newmoon.raw");


I can not figure out how to call up the image using pointer



I managed to solve correcting code

now it works fine

thank you

Post Number:#11 Post Mon Jun 27, 2016 3:28 am
Posts: 69
Topics: 18
Images: 2
Solve rating: 1
Joined: Tue Apr 14, 2015 11:54 pm
Topics: 18
Age: 42
Gender: Male
National Flag:
Indonesia
thx all and fernando.

:-bd :-bd
is works fine.

go to hardwork to change visual display.




  • Similar Topics
    Replies
    Views
    Last post

Return to Ferduino code





Who is online

Users viewing this topic: No registered users and 1 guest

cron