您当前的位置:五五电子网电子知识单片机-工控设备AVR单片机icc avr LCD1602显示屏程序 正文
icc avr LCD1602显示屏程序

icc avr LCD1602显示屏程序

点击数:7259 次   录入时间:03-04 12:03:21   整理:http://www.55dianzi.com   AVR单片机

    else if(!strcmp(str,"GO_HOME"))        //set AC go home
        write(0,0x02);
/*--------------------------------------------------
isACinc & shiftEn 共用一个命令设置
--------------------------------------------------*/
    else if(!strcmp(str,"INC_AC"))        //set AC as inc mode
    {
        isACinc=1;
        if(shiftEn)
            write(0,0x07);
        else 
            write(0,0x06);
    }        
    else if(!strcmp(str,"DEC_AC"))        //set AC as dec mode
    {    
        isACinc=0;
        if(shiftEn)
            write(0,0x05);
        else
            write(0,0x04);
    }        
    else if(!strcmp(str,"EN_SHIFT"))    //enable shift
    {
        shiftEn=1;
        if(isACinc)
            write(0,0x07);
        else
            write(0,0x06);
    }
    else if(!strcmp(str,"DIS_SHIFT"))    //disable shift
    {
        shiftEn=0;
        if(isACinc)
            write(0,0x05);
        else
            write(0,0x04);
    }    
/*--------------------------------------------------
dispEn & cursorEn & blinkEn共用一个命令设置
--------------------------------------------------*/
    else if(!strcmp(str,"OPEN_LCD"))    //opern lcd
    {
        dispEn=1;
        if(cursorEn)
            if(blinkEn)
                write(0,0x0F);
            else
                write(0,0x0E);
        else
            if(blinkEn)
                write(0,0x0D);
            else
                write(0,0x0C);
    }        
    else if(!strcmp(str,"CLOSE_LCD"))    //close lcd
    {
        dispEn=0;
        if(cursorEn)
            if(blinkEn)
                write(0,0x0B);
            else
                write(0,0x0A);
        else
            if(blinkEn)
                write(0,0x09);
            else
                write(0,0x08);
    }    
    else if(!strcmp(str,"OPEN_CURS"))    //open cursor    
    {
        cursorEn=1;
        if(dispEn)
            if(blinkEn)
                write(0,0x0F);
            else
                write(0,0x0E);
        else
            if(blinkEn)
                write(0,0x0B);
            else
                write(0,0x0A);
    }    
    else if(!strcmp(str,"CLOSE_CURS"))    //close cursor
    {
        cursorEn=0;
        if(dispEn)
            if(blinkEn)
                write(0,0x0D);
            else
                write(0,0x0C);
        else
            if(blinkEn)
                write(0,0x09);
            else
                write(0,0x08);
    }
    else if(!strcmp(str,"EN_BLINK"))    //enable blink cursor
    {

上一页  [1] [2] [3] [4] [5]  下一页


本文关键字:程序  显示屏  AVR单片机单片机-工控设备 - AVR单片机