testlcd.c

来自「Source code for driving RFM01 fm radio r」· C语言 代码 · 共 74 行

C
74
字号
/* ------------------------------------------------------------------------- */
/*	Test wy渨ietlacza LCD						     */
/* ------------------------------------------------------------------------- */

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

/* ------------------------------------------------------------------------- */
/*			   Definicje funkcji				     */
/* ------------------------------------------------------------------------- */

void delayms1(void)
{
  delayms(1);
}

/* ------------------------------------------------------------------------- */

/* ------------------------------------------------------------------------- */
/* ----------------		 Program glowny 	    ---------------- */
/* ------------------------------------------------------------------------- */

int main(void)
{
  LCD_init();			// inicjalizacja wy渨ietlacza

  while(1)			// p阾la niesko馽zona
  {
    LCD_putstr_P(PSTR(" Testowanie LCD"));
    LCD_xy(6,1);
    LCD_putstr_P(PSTR("DEMO"));
    LCD_xy(0,2);
    LCD_putstr_P(PSTR(" Testowanie LCD"));
    LCD_xy(6,3);
    LCD_putstr_P(PSTR("DEMO"));
    delayms1();

    LCD_clear();
    LCD_putstr_P(PSTR("Zawijanie tekstu na wyswietlaczu"));
    delayms1();

    LCD_clear();
    LCD_putstr_P(PSTR("_cursor_on()"));
    LCD_cursor_on();
    delayms1();

    LCD_clear();
    LCD_putstr_P(PSTR("_right_left_"));
    delayms1();
    LCD_cursor_right();
    delayms1();
    LCD_cursor_right();
    delayms1();
    LCD_cursor_left();
    delayms1();
    LCD_cursor_left();
    delayms1();

    LCD_clear();
    LCD_putstr_P(PSTR("_cursor_off()"));
    LCD_cursor_off();
    delayms1();

    LCD_clear();
  }
}

/* ------------------------------------------------------------------------- */
/*		Koniec programu Test LCD na AVR               		     */
/* ------------------------------------------------------------------------- */


⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?