Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
19 years ago

DE2 LCD problem

hello,everyone.

I am new to NiosII processor,and my board is DE2.Now I want to display some words on the LCD sreen,but failed.I am sure that the power and backlight of the lcd have already been connected?i want to ask why?help me please.the programme is given as follow:# include "alt_types.h"# include <stdio.h> http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/sad.gif # include <unistd.h># include "system.h"# include "sys/alt_irq.h"# include "altera_avalon_pio_regs.h"

/* Integer ASCII value of the ESC character. */# define ESC 27

/* Position cursor at row 1, column 1 of LCD. */# define ESC_TOP_LEFT "[1;0H"

/* Position cursor at row2, column 5 of LCD. */# define ESC_COL2_INDENT5 "[2;5H"

/* Clear */# define ESC_CLEAR "K"

/* Position cursor at row1, column 5 of LCD. */# define ESC_COL1_INDENT5 "[1;5H"

# ifdef LCD_DISPLAY_BASE

static void lcd_init( FILE *lcd )

{

fprintf(lcd, "%c%s Counting will be displayed below...", ESC, ESC_TOP_LEFT);

}# endif

int main(void)

{

FILE * lcd;# ifdef LCD_DISPLAY_NAME

lcd = fopen("/dev/lcd_display", "w");

lcd_init( lcd );# endif

return(0);

}
No RepliesBe the first to reply