Вот написал массив:
Код: Выделить всё
flash byte[][8]={
0b0000000,
0b0001110,
0b0010001,
0b0010001,
0b0010001,
0b0001010,
0b0011011,
0b0000000,
};
Код: Выделить всё
flash byte[][8]={
0b0000000,
0b0001110,
0b0010001,
0b0010001,
0b0010001,
0b0001010,
0b0011011,
0b0000000,
};
Код: Выделить всё
Example:
/* LCD user defined characters
Chip: ATmega8515
Memory Model: SMALL
Data Stack Size: 128 bytes
Use an 2x16 alphanumeric LCD connected
to the STK600 PORTC header as follows:
[LCD] [STK600 PORTC HEADER]
1 GND- 9 GND
2 +5V- 10 VCC
3 VLC- LCD HEADER Vo
4 RS - 1 PC0
5 RD - 2 PC1
6 EN - 3 PC2
11 D4 - 5 PC4
12 D5 - 6 PC5
13 D6 - 7 PC6
14 D7 - 8 PC7
The connections must be specified in the
Project|Configure|C Compiler|Libraries|Alphanumeric LCD menu */
/* include the LCD driver routines */
#include <alcd.h>
typedef unsigned char byte;
/* table for the user defined character
arrow that points to the top right corner */
flash byte char0[8]={
0b10000000,
0b10001111,
0b10000011,
0b10000101,
0b10001001,
0b10010000,
0b10100000,
0b11000000};
/* function used to define user characters */
void define_char(byte flash *pc,byte char_code)
{
byte i,a;
a=(char_code<<3) | 0x40;
for (i=0; i<8; i++) lcd_write_byte(a++,*pc++);
}
void main(void)
{
/* initialize the LCD for 2 lines & 16 columns */
lcd_init(16);
/* define user character 0 */
define_char(char0,0);
/* switch to writing in Display RAM */
lcd_gotoxy(0,0);
lcd_putsf("User char 0:");
/* display used defined char 0 */
lcd_putchar(0);
while (1); /* loop forever */
}
Пример (проект CVAVR) лежит у Вас в папке cvavr\EXAMPLES\LCDCHAR\ и доступен во всех версиях от 1.25 до 3.12 включительно.ATMEL86 писал(а):Если не трудно напишите пример