Go Down

Topic: lcd 5110 bug (Read 149 times) previous topic - next topic

MoRommy

Jul 14, 2017, 11:31 am Last Edit: Jul 14, 2017, 11:38 am by MoRommy
Hi ! I made a photo in paint whose size is 15x14 pizels, with an "X" and after that i converted it into ".c" document witch i placed in the project folder. That (.c) looks like :

Code: [Select]

//------------------------------------------------------------------------------
// File generated by LCD Assistant
// http://en.radzio.dxp.pl/bitmap_converter/
//------------------------------------------------------------------------------

#include <avr/pgmspace.h>

const unsigned char x [] PROGMEM= {
0x00, 0x02, 0x06, 0x0C, 0x18, 0x30, 0xE0, 0xC0, 0xE0, 0x30, 0x18, 0x0C, 0x06, 0x02, 0x00, 0x00,
0x10, 0x18, 0x0C, 0x06, 0x03, 0x01, 0x00, 0x01, 0x03, 0x06,
};


The .bmp file is : "Imagine Bitmap noua (2).bmp"

So, i have that code in Arduino program :

Code: [Select]

#include <LCD5110_Graph.h>

LCD5110 lcd(6,5,4,2,3);

extern uint8_t x[];

void setup()
{

Serial.begin(9600);

  lcd.InitLCD();

}

void loop()
{

 lcd.drawBitmap(0,0,x,15,14);
  lcd.update();

 }


After upload it , i saw a little bug in that "x" , about 4 pixels it's placed wrong , like in the "ico.jpg" photo.

What can I do ?


aarg

How did you convert it into a "c" document? Are you sure you didn't swap X and Y?
  ... with a transistor and a large sum of money to spend ...
Please don't PM me with technical questions. Post them in the forum.

MoRommy

#2
Jul 14, 2017, 11:51 am Last Edit: Jul 14, 2017, 12:08 pm by MoRommy
with a program called LCDAssistant (I upload my file and after i clicked on save output , chose the project folder , and name it with .c ) , and yes, i'm sure.

aarg

Shouldn't you have 2x14 = 28 bytes in your array?
  ... with a transistor and a large sum of money to spend ...
Please don't PM me with technical questions. Post them in the forum.

MoRommy


aarg

You have 25 bytes in your array. That is 200 bits. 15x14 = 210. I leave the rest as an exercise to the student.
  ... with a transistor and a large sum of money to spend ...
Please don't PM me with technical questions. Post them in the forum.

Go Up