AtmelStudio and LCD hd44780

Status
Not open for further replies.

be80be

Well-Known Member
Joerg Wunsch wrote some lcd code I hacked to work on a attiny2313 figured I'd post this someone may want use it.
I changed the code to just work with the LCD hd44780
Code:
/*
 * ----------------------------------------------------------------------------
 * "THE BEER-WARE LICENSE" (Revision 42):
 * <joerg@FreeBSD.ORG> wrote this file.  As long as you retain this notice you
 * can do whatever you want with this stuff. If we meet some day, and you think
 * this stuff is worth it, you can buy me a beer in return.        Joerg Wunsch
 * ----------------------------------------------------------------------------
 *
 * LCD demo
 *
 * 
 */

#include "defines.h"

#include <ctype.h>
#include <stdint.h>
#include <stdio.h>

#include <avr/io.h>
#include <avr/pgmspace.h>

#include <util/delay.h>

#include "lcd.h"
//#include "uart.h"

/*
 * Do all the startup-time peripheral initializations.
 */
static void
ioinit(void)
{
  lcd_init();
}

//FILE uart_str = FDEV_SETUP_STREAM(uart_putchar, uart_getchar, _FDEV_SETUP_RW);
FILE lcd_str = FDEV_SETUP_STREAM(lcd_putchar, NULL, _FDEV_SETUP_WRITE);


int
main(void)
{
 
  ioinit();


  stderr = &lcd_str;

  fprintf(stderr, "Hello world!\n"); //prints out what you put here

 
}
The zip lcd2 has all the file to use wit AtmelStudio
 

Attachments

  • lcd2.zip
    43.7 KB · Views: 299
Last edited:
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…