Skip to main content
added 59 characters in body
Source Link
user2279603
  • 157
  • 3
  • 7
  • 19
 #include "U8glib.h" U8GLIB_PCD8544 u8g(8, 4, 7, 5, 6); // CLK=8, DIN=4, CE=7, DC=5, RST=6 int x = 5; int y = 5; const uint8_t rook_bitmap[] U8G_PROGMEM = { 0xE0, 0x90, 0x8C, 0x82, 0x81, 0xA9, 0x39, 0x01, 0x02, 0x0C, 0x30, 0xC0, 0x00, 0x00, 0x00, 0x70, 0x8E, 0x01, 0x82, 0x8C, 0x70, 0x00, 0x01, 0x02, 0x22, 0x5C, 0x44, 0x44, 0x80, 0x84, 0x8A, 0x08, 0x80, 0xC1, 0x46, 0x7C, 0x22, 0x11, 0x0C, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, }; void draw(void) { // graphic commands to redraw the complete screen should be placed here u8g.drawBitmapP( 5, 5, 21,18, rook_bitmap); } void setup(void) { } void loop(void) { // picture loop u8g.firstPage(); do { draw(); } while( u8g.nextPage() ); // y++; // rebuild the picture after some delay  delay(1000); } 

U8GLIB_PCD8544 u8g(8, 4, 7, 5, 6); // CLK=8, DIN=4, CE=7, DC=5, RST=6

int x = 5; int y = 5;

int level = 5;

const uint8_t rook_bitmap[] U8G_PROGMEM = { 0x7E, 0x82, 0x04, 0x8E, 0x7A, 0x42, 0xB4, 0x24, 0x08, 0xD8, 0x48, 0x08, 0x08, 0x0C, 0x02, 0x22, 0xD9, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x1E, 0x11, 0x21, 0x22, 0x14, 0x3B, 0xD4, 0x25, 0x29, 0x68, 0xA8, 0xA8, 0x74, 0x0C, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, };

void draw(void) { // graphic commands to redraw the complete screen should be placed here
u8g.drawBitmapP( 5, 5, 3,18, rook_bitmap);

}

void setup(void) {

}

void loop(void) { // picture loop u8g.firstPage();
do { draw(); } while( u8g.nextPage() );

// y++; // rebuild the picture after some delay delay(1000); }

 #include "U8glib.h" U8GLIB_PCD8544 u8g(8, 4, 7, 5, 6); // CLK=8, DIN=4, CE=7, DC=5, RST=6 int x = 5; int y = 5; const uint8_t rook_bitmap[] U8G_PROGMEM = { 0xE0, 0x90, 0x8C, 0x82, 0x81, 0xA9, 0x39, 0x01, 0x02, 0x0C, 0x30, 0xC0, 0x00, 0x00, 0x00, 0x70, 0x8E, 0x01, 0x82, 0x8C, 0x70, 0x00, 0x01, 0x02, 0x22, 0x5C, 0x44, 0x44, 0x80, 0x84, 0x8A, 0x08, 0x80, 0xC1, 0x46, 0x7C, 0x22, 0x11, 0x0C, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, }; void draw(void) { // graphic commands to redraw the complete screen should be placed here u8g.drawBitmapP( 5, 5, 21,18, rook_bitmap); } void setup(void) { } void loop(void) { // picture loop u8g.firstPage(); do { draw(); } while( u8g.nextPage() ); // y++; // rebuild the picture after some delay  delay(1000); } 
#include "U8glib.h" 

U8GLIB_PCD8544 u8g(8, 4, 7, 5, 6); // CLK=8, DIN=4, CE=7, DC=5, RST=6

int x = 5; int y = 5;

int level = 5;

const uint8_t rook_bitmap[] U8G_PROGMEM = { 0x7E, 0x82, 0x04, 0x8E, 0x7A, 0x42, 0xB4, 0x24, 0x08, 0xD8, 0x48, 0x08, 0x08, 0x0C, 0x02, 0x22, 0xD9, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x1E, 0x11, 0x21, 0x22, 0x14, 0x3B, 0xD4, 0x25, 0x29, 0x68, 0xA8, 0xA8, 0x74, 0x0C, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, };

void draw(void) { // graphic commands to redraw the complete screen should be placed here
u8g.drawBitmapP( 5, 5, 3,18, rook_bitmap);

}

void setup(void) {

}

void loop(void) { // picture loop u8g.firstPage();
do { draw(); } while( u8g.nextPage() );

// y++; // rebuild the picture after some delay delay(1000); }

fix code block
Source Link
Gerben
  • 11.3k
  • 3
  • 22
  • 34

Hello I finally got my nokia 5110 lcd working, I have tested it by displaying bitmap images other people have made. I made my own image and then used lcd assistant to turn it into an array. First look at my code.

 #include "U8glib.h" U8GLIB_PCD8544 u8g(8, 4, 7, 5, 6); // CLK=8, DIN=4, CE=7, DC=5, RST=6 int x = 5; int y = 5; const uint8_t rook_bitmap[] U8G_PROGMEM = { 0xE0, 0x90, 0x8C, 0x82, 0x81, 0xA9, 0x39, 0x01, 0x02, 0x0C, 0x30, 0xC0, 0x00, 0x00, 0x00, 0x70, 

0x8E, 0x01, 0x82, 0x8C, 0x70, 0x00, 0x01, 0x02, 0x22, 0x5C, 0x44, 0x44, 0x80, 0x84, 0x8A, 0x08, 0x80, 0xC1, 0x46, 0x7C, 0x22, 0x11, 0x0C, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, };

0x8E, 0x01, 0x82, 0x8C, 0x70, 0x00, 0x01, 0x02, 0x22, 0x5C, 0x44, 0x44, 0x80, 0x84, 0x8A, 0x08, 0x80, 0xC1, 0x46, 0x7C, 0x22, 0x11, 0x0C, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, };  void draw(void) { // graphic commands to redraw the complete screen should be placed here u8g.drawBitmapP( 5, 5, 21,18, rook_bitmap); } void setup(void) { } void loop(void) { // picture loop u8g.firstPage(); do { draw(); } while( u8g.nextPage() ); // y++; // rebuild the picture after some delay delay(1000); } 

The part that goes wrong is at u8g.drawBitmapP(5,5,21,18, rook_bitmap); I know it is to do with the 21 and 18 being wrong because I don't know where to get those numbers. Is it the width and height of the image when it is in paint.net or what is it?

Hello I finally got my nokia 5110 lcd working, I have tested it by displaying bitmap images other people have made. I made my own image and then used lcd assistant to turn it into an array. First look at my code.

 #include "U8glib.h" U8GLIB_PCD8544 u8g(8, 4, 7, 5, 6); // CLK=8, DIN=4, CE=7, DC=5, RST=6 int x = 5; int y = 5; const uint8_t rook_bitmap[] U8G_PROGMEM = { 0xE0, 0x90, 0x8C, 0x82, 0x81, 0xA9, 0x39, 0x01, 0x02, 0x0C, 0x30, 0xC0, 0x00, 0x00, 0x00, 0x70, 

0x8E, 0x01, 0x82, 0x8C, 0x70, 0x00, 0x01, 0x02, 0x22, 0x5C, 0x44, 0x44, 0x80, 0x84, 0x8A, 0x08, 0x80, 0xC1, 0x46, 0x7C, 0x22, 0x11, 0x0C, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, };

 void draw(void) { // graphic commands to redraw the complete screen should be placed here u8g.drawBitmapP( 5, 5, 21,18, rook_bitmap); } void setup(void) { } void loop(void) { // picture loop u8g.firstPage(); do { draw(); } while( u8g.nextPage() ); // y++; // rebuild the picture after some delay delay(1000); } 

The part that goes wrong is at u8g.drawBitmapP(5,5,21,18, rook_bitmap); I know it is to do with the 21 and 18 being wrong because I don't know where to get those numbers. Is it the width and height of the image when it is in paint.net or what is it?

Hello I finally got my nokia 5110 lcd working, I have tested it by displaying bitmap images other people have made. I made my own image and then used lcd assistant to turn it into an array. First look at my code.

 #include "U8glib.h" U8GLIB_PCD8544 u8g(8, 4, 7, 5, 6); // CLK=8, DIN=4, CE=7, DC=5, RST=6 int x = 5; int y = 5; const uint8_t rook_bitmap[] U8G_PROGMEM = { 0xE0, 0x90, 0x8C, 0x82, 0x81, 0xA9, 0x39, 0x01, 0x02, 0x0C, 0x30, 0xC0, 0x00, 0x00, 0x00, 0x70, 0x8E, 0x01, 0x82, 0x8C, 0x70, 0x00, 0x01, 0x02, 0x22, 0x5C, 0x44, 0x44, 0x80, 0x84, 0x8A, 0x08, 0x80, 0xC1, 0x46, 0x7C, 0x22, 0x11, 0x0C, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, };  void draw(void) { // graphic commands to redraw the complete screen should be placed here u8g.drawBitmapP( 5, 5, 21,18, rook_bitmap); } void setup(void) { } void loop(void) { // picture loop u8g.firstPage(); do { draw(); } while( u8g.nextPage() ); // y++; // rebuild the picture after some delay delay(1000); } 

The part that goes wrong is at u8g.drawBitmapP(5,5,21,18, rook_bitmap); I know it is to do with the 21 and 18 being wrong because I don't know where to get those numbers. Is it the width and height of the image when it is in paint.net or what is it?

Source Link
user2279603
  • 157
  • 3
  • 7
  • 19

Arduino drawing a bitmap on nokia 5110 lcd

Hello I finally got my nokia 5110 lcd working, I have tested it by displaying bitmap images other people have made. I made my own image and then used lcd assistant to turn it into an array. First look at my code.

 #include "U8glib.h" U8GLIB_PCD8544 u8g(8, 4, 7, 5, 6); // CLK=8, DIN=4, CE=7, DC=5, RST=6 int x = 5; int y = 5; const uint8_t rook_bitmap[] U8G_PROGMEM = { 0xE0, 0x90, 0x8C, 0x82, 0x81, 0xA9, 0x39, 0x01, 0x02, 0x0C, 0x30, 0xC0, 0x00, 0x00, 0x00, 0x70, 

0x8E, 0x01, 0x82, 0x8C, 0x70, 0x00, 0x01, 0x02, 0x22, 0x5C, 0x44, 0x44, 0x80, 0x84, 0x8A, 0x08, 0x80, 0xC1, 0x46, 0x7C, 0x22, 0x11, 0x0C, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, };

 void draw(void) { // graphic commands to redraw the complete screen should be placed here u8g.drawBitmapP( 5, 5, 21,18, rook_bitmap); } void setup(void) { } void loop(void) { // picture loop u8g.firstPage(); do { draw(); } while( u8g.nextPage() ); // y++; // rebuild the picture after some delay delay(1000); } 

The part that goes wrong is at u8g.drawBitmapP(5,5,21,18, rook_bitmap); I know it is to do with the 21 and 18 being wrong because I don't know where to get those numbers. Is it the width and height of the image when it is in paint.net or what is it?