⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tst_lcd.c

📁 Low End Microchip PICs C函数
💻 C
字号:
// Program TST_LCD.C (PIC16C505), CCS, PCB
//
// Direct Interface with Optrex DMC20434.
//
// Illustrates the various features of the routines in LCD_OUT.C
//
// Displays a string, byte in decimal format and in hex format.
//
// copyright, Peter H. Anderson, Brattleboro, VT, July, '01

#case

#device PIC16C505 *=8

#include <defs_505.h>
#include <lcd_out.h>
#include <delay.h>

void main(void)
{
    byte n, q;
    byte const str_const[20] = {"   Hello World"};

    DIRC = 0x3f;
    DIRB = 0x3f;

    lcd_init();
    q = 0;
    while(1)
    {

       lcd_clr_line(0);       // beginning of line 0
       n=0;
       while (str_const[n])
       {
          lcd_char(str_const[n]);
          ++n;
       }
       lcd_clr_line(1);
       lcd_dec_byte(q, 3);
       lcd_cursor_pos(1, 10); // line 1, position 10
       lcd_hex_byte(q);

       ++q;  // modify the displayed quantity

       delay_ms(1000);
   }
}

#include <lcd_out.c>
#include <delay.c>

⌨️ 快捷键说明

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