Code Monkey home page Code Monkey logo

lcd1602a_h68's Introduction

lcd1602a_h68

A simple library useful for using lcd1602a

Install

  1. Install the library first.
  2. Copy the files in the lib folder.
  3. Paste and use in your avr project folder.
$ git clone https://github.com/ga-mang/lcd1602a_h68.git

Example

See lib/lcd1602a_h68.h for more information on how to use it.

Example 1

// example/main.c
#define F_CPU 16000000UL
#include <avr/io.h>
#include <util/delay.h>
#include "lcd1602a_h68.h"

int main(void)
{
    struct lcd1602a_port port = {&DDRC, &DDRC, &PORTC, &PORTC};

    set_lcd_bit(4);
    set_lcd_port(port);
    lcd_init(LCD_ROWS_MAX - 6, LCD_COLS_MAX);

    while (1)
    {
        lcd_puts("12345678901234567890");
        _delay_ms(500);
        lcd_clear();
        _delay_ms(500);
    }
}

Execution result

example

Example 2

// example2/main.c
#define F_CPU 16000000UL
#include <avr/io.h>
#include <util/delay.h>
#include "lcd1602a_h68.h"

int main(void)
{
	int i = 0, n = 0;
	struct lcd1602a_port port = { &DDRE, &DDRE, &PORTE, &PORTE };

	uint8_t heart[2][8] = {
		{0x00, 0x0A, 0x1F, 0x1F, 0x1F, 0x0E, 0x04,0x00 },
		{0x00, 0x0A, 0x15, 0x11, 0x11, 0x0A, 0x04,0x00 }
	};

	set_lcd_bit(4);
	set_lcd_port(port);
	lcd_init(LCD_ROWS_MAX, LCD_COLS_MAX);

	lcd_create_char(0, heart[n]);

	for(i = 0; i < 32; i++)
		lcd_putc(0x00);

	while (1)
	{
		lcd_create_char(0, heart[n]);
		_delay_ms(1000);

		n = !n;
	}
}

Execution result

example 2

Example 3

// example3/main.c
#define F_CPU 16000000UL
#include <avr/io.h>
#include <util/delay.h>
#include "lcd1602a_h68.h"

int main(void)
{
	struct lcd1602a_port port = {&DDRC, &DDRC, &PORTC, &PORTC};

	set_lcd_bit(4);
	set_lcd_port(port);
	lcd_init(LCD_ROWS_MAX, LCD_COLS_MAX);

	lcd_move(0, 0);
	lcd_puts("LCD1602A_H68");
	lcd_move(0, 1);
	lcd_puts("HELLO WORLD!");

	while (1)
	{
		lcd_display_shift_str(LCD_SHIFT_RIGHT, 12);
		_delay_ms(200);
	}
}

Execution result

example 2

lcd1602a_h68's People

Contributors

yunseo-h68 avatar

Stargazers

JaeGwan Lee avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.