displaying-icon-on-the-glcd-screen-sap1024b-t6963c

Displaying Icon on the GLCD Screen – SAP1024B/T6963C

This post is also available in: Türkçe Azerbaycan Türkcesi Русский

  • In the lesson “GLCD SCREEN LIBRARY – (SAP1024B – T6963C)” which I have published before is used.
  • You will see how you can use any image, you have designed or found on the internet, on GLCD ;)
  • The aim is to provide interaction among the icons independently which we will use while designing menu on GLCD. Thus when a sign changes we don’t need to renew or arrange other icons ;)
  • It will provide us great convenience in terms of time and file space

Codes

#include "dizi.c"
char SAPTRIS at trisd;//data portları
char SAPDATA_giris at portd;
char SAPDATA_cikis at latd;
sbit SAP1024_RD at RC1_bit ; //GLCD RD UCU BAĞLANTI PİNİ
sbit SAP1024_CE at rc2_bit ; //GLCD CE UCU BAĞLANTI PİNİ
sbit SAP1024_CD at Rc3_bit ; //GLCD C/D UCU BAĞLANTI PİNİ
sbit SAP1024_RST at Rc4_bit ; //GLCD RST UCU BAĞLANTI PİNİ
sbit SAP1024_FS at Rc5_bit ; //GLCD FS UCU BAĞLANTI PİNİ
sbit SAP1024_WR at RC0_bit ; //GLCD wr UCU BAĞLANTI PİNİ

sbit SAP1024_RD_Direction at TRISC1_bit; //GLCD RD UCU BAĞLANTI PİNİ
sbit SAP1024_CE_Direction at TRISC2_bit; //GLCD CE UCU BAĞLANTI PİNİ
sbit SAP1024_CD_Direction at TRISC3_bit; //GLCD C/D UCU BAĞLANTI PİNİ
sbit SAP1024_RST_Direction at TRISC4_bit; //GLCD RST UCU BAĞLANTI PİNİ
sbit SAP1024_FS_Direction at TRISC5_bit; //GLCD FS UCU BAĞLANTI PİNİ
sbit SAP1024_WR_Direction at TRISC0_bit; //GLCD FS UCU BAĞLANTI PİNİ



void main
{
cmcon|=7;
SAP1024_INIT(240,128,8);
SAP1024_LCD_SIMGE_BAS(100,0,dizi,85,85,0);
SAP1024_LCD_SIMGE_BAS(0,0,dizi,85,85,0);
delay_ms(1000);
SAP1024_LCD_SIMGE_BAS(0,0,dizi,85,85,1);
}
//Image Codes
const unsigned char dizi [] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x01, 0xF0, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xC0, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x03, 0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00,
0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0x00, 0x00,
0x00, 0x00, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0x00, 0x00,
0x00, 0x00, 0x03, 0xFF, 0xFF, 0xF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 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xC0, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x03, 0x00, 0x03, 0x00, 0x01, 0x00, 0x11, 0x00, 0x00, 0x00,
0x18, 0x00, 0x01, 0x00, 0x1A, 0x00, 0x04, 0x00, 0x28, 0x00,
0x02, 0x00, 0x38, 0x00, 0x00, 0x00, 0x4A, 0x02, 0x00, 0x00,
0x5F, 0x02, 0x00, 0x00, 0x7B, 0x03, 0x03, 0x00, 0x97, 0x05,
0x09, 0x00, 0xAF, 0x0E, 0x0F, 0x00, 0xC1, 0x17, 0x16, 0x00,
0xD5, 0x25, 0x29,
};

Important Notes

  • Because of that the library is written for GLCDs using SAP1024B and T6963C integrations it won’t work on GLCDs having other driver integration
  • On the LCD Assistant program “horizontal” have to be chosen. Because the driver integrations mentioned above makes horizontal scanning.
  • the name of set created and the name of set in SAP1024_LCD_SIMGE_BAS function must be same.
  • Images being used must be turned into 1 bit. Because the GLCDs we use are 1 bit so they can be White or black.
  • Images’ sizes should be arranged in advance. If you arrange in MikroC view will be damaged.

Required Files




 

About ERCAN KOÇLAR

Çalışmalarım çocukken başladı kolonyalı kağıtları yakmak, ilaçları birbirine katmak gibi değişik deneylerim vardı. Kimya kitabında elektroliz ile suyun hidrojen ve oksijene ayrıldığı ve hidrojenin yandığını yazıyordu, o zamanlarda aklım almıyordu sudan nasıl yanan….Devamını okumak için tıklayınız ;)