unsigned char data[] = {127,127,8,8,127,127,0,0}; // H, 8x8
void GRAPHIC_LCD_INIT()
{
output_high(RESET); // RST connected to PIN_C0
output_high(CS1); // CS1 connected to PIN_B0
output_high(CS2); // CS2 connected to PIN_B1
glcd_cmd(0x3F); // Display ON
glcd_cmd(0xB8); // Page selection - Page 1
glcd_cmd(0x40); // Column selection
}
void glcd_cmd(unsigned char c)
{
output_d(c);
output_low(RS);
output_low(RW);
output_high(EN);
delay_ms(15);
output_low(EN);
}
void glcd_data(unsigned char z)
{
output_d(z);
output_high(RS);
output_high(RW);
output_high(EN);
delay_ms(15);
output_low(EN);
}
void main()
{
GRAPHIC_LCD_INIT();
while(1)
{
glcd_cmd(0xC0); // display start line
glcd_data(data);
}
}
void glcd_data(unsigned char z)
{
output_high(RS);
output_low(RW);
output_d(z);
output_high(EN);
delay_ms(15);
output_low(EN);
}
[syntax=c]
unsigned char data[] = {127,127,8,8,127,127,0,0}; // H, 8x8
void GRAPHIC_LCD_INIT()
{
output_high(CS1); // CS1 connected to PIN_B0
output_high(CS2); // CS2 connected to PIN_B1
output_high(RESET); // RST connected to PIN_C0
glcd_cmd(0x3F); // Display ON
glcd_cmd(0xB8); // Page selection - Page 1
glcd_cmd(0x40); // Column selection
}
void glcd_cmd(unsigned char c)
{
output_d(c);
output_low(RS);
output_low(RW);
output_high(EN);
delay_ms(15);
output_low(EN);
}
void glcd_data(unsigned char z)
{
output_d(z);
output_high(RS);
output_low(RW);
output_high(EN);
delay_ms(15);
output_low(EN);
}
void main()
{
int i;
GRAPHIC_LCD_INIT();
glcd_cmd(0xC0); // display start line
while(1)
{
for (i = 0; i < 8; i++)
glcd_data(data[i]);
}
}[/syntax]
void main()
{
int i;
GRAPHIC_LCD_INIT();
output_low(CS1); // CS1 connected to PIN_B0
output_low(CS2); // CS2 connected to PIN_B1
glcd_cmd(0xC1); // display start line
while(1)
{
for (i = 0; i < 8; i++)
{
/*printf(glcd_data,"%d",data[i]);*/
glcd_data(data[i]);
}
}
}
while(1)
{
glcd_cmd(0xC0);
for (i = 0; i < 8; i++)
{
glcd_data(data[i]);
}
}
glcd_cmd(0xC0);
glcd_cmd(0x40);
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?