lcd_test.c


1
/*************************************************************************
2
Title:    testing output to a HD44780 based LCD display.
3
Author:   Peter Fleury  <pfleury@gmx.ch>  http://jump.to/fleury
4
File:     $Id: test_lcd.c,v 1.3 2003/12/10 19:32:48 peter Exp $
5
Software: AVR-GCC 3.3
6
Hardware: HD44780 compatible LCD text display
7
          ATS90S8515/ATmega if memory-mapped LCD interface is used
8
          any AVR with 7 free I/O pins if 4-bit IO port mode is used
9
**************************************************************************/
10
11
#include <stdlib.h>
12
#include <avr/io.h>
13
#include "lcd.h"
14
#include <inttypes.h>                                               // Allgemeine Bibliotheken
15
/*#include <avr/eeprom.h>*/
16
 
17
18
19
20
int main(void)
21
{
22
  DDRA=0x00;                                                  // Port A auf Eingang (hier kommen die Tastereingaben rein)
23
    PINA=0xFF;                                                  // Alle Eingänge auf 0
24
  DDRD=0xFF;                          // PORT D als Ausgang (Auto-Ampel Längs- und Querverkehr)
25
  PORTD=0xFF;                          // Alle Ausgänge auf 1
26
  DDRC=0xFF;                          // Port C als Ausgang (Fußgänger-Ampel Längs- und Querverkehr)
27
  PORTC=0xFF;                          // Alle Ausgänge auf 1
28
  
29
  lcd_init(LCD_DISP_ON); // LCD initialisieren
30
  lcd_gotoxy(0,0);
31
  lcd_puts("Hello World");
32
    
33
}