8090私人影院_中文字幕无码乱人妻_制服丝袜自拍另类第1页_香蕉在线视频

歡迎光臨蘇州啟普微電子有限公司!

收藏網(wǎng)站 在線留言 網(wǎng)站地圖

晶拓液晶屏

晶拓 —— 14年專注LCD液晶屏定制服務(wù)段碼液晶屏設(shè)計(jì)及生產(chǎn)服務(wù)商

LCD液晶屏全國(guó)訂制熱線:13862038982

新聞資訊-聚焦行業(yè),創(chuàng)新服務(wù),晶拓品牌長(zhǎng)遠(yuǎn)發(fā)展

HOLTEK合泰單片機(jī)驅(qū)動(dòng)段碼液晶屏顯示程序

作者: 晶拓小編 編輯: 晶拓液晶屏 來(lái)源: 晶拓液晶屏工廠 發(fā)布日期: 2018.09.18
信息摘要:
HOLTEK合泰單片機(jī)驅(qū)動(dòng)段碼液晶屏顯示程序

             //======================================================//
// 產(chǎn)品型號(hào): 2323223323 //
//   微控制器: HT49R30A-1 //
//     軟件版本: 2.00 for RC (2.8MHz) //
// 2323232332323 //
//======================================================//

#include
#include "RS7001RC.h"

void main()
{
initial();
DispLCD(Length);

while (1)
{
_clrwdt();
ScanKey();
ScanStart();
LengthSetup();
Start_End();
}
}

/* ============================ Delay ========================== */
void delay(unsigned char cnt)
{
unsigned char i,j;
for (i=0;i<=cnt;i++)
{
for (j=0;j<=100;j++){ _clrwdt(); }
_clrwdt();

}
/* ========================== Initial ========================== */
void initial(void)
{
C_MT1  = 0; C_MT2Z = 0; C_MT2F = 0;
delay(20);

SwitchStart=0; KeyDown=0; KeySetup=0; KeyUp=0;
StartFlag=1; StopFlag=0;
CutFlag=0; SetupFlag=0; ResendFlag=0;
BusyFlag=0; InitFlag=0; ResetFlag=0;
LCD_count=0; Cut_count=0; LC_Str=1;

if(!_to)  { Length = 45;  }

_tmrc = 0xb0; _tmr  = 0x38;
_tmrc = 0xa0; _tmrc = 0xb0;
_eti  = 1; // Timer0 interrupt
_eei0 = 1; // INT0  interrupt
_emi  = 1; // Total interrupt

if(End) { CutFlag=1; Cut_count=5100; }
}

/* ========================= ScanKey =========================== */
void ScanKey(void)
{
if(Start){ StartFlag=1; }

if( Down==0 | Setup==0 | Up==0 )
{
delay(5);
if( Down==0 | Setup==0 | Up==0 )
{
if(Down==0)

if(SetupFlag)
{
while(!Down) { _clrwdt(); }
KeyDown = 1; 
}
else
{
if(Up==0)

while(!Up) { _clrwdt(); }
InitFlag = 1;
}
}
}
if(Setup==0)

while(!Setup) { _clrwdt(); }
KeySetup = 1; 
}
if(Up==0)

if(SetupFlag)
{
while(!Up) { _clrwdt(); }
KeyUp = 1; 
}
}
}
else 
{
KeyDown=0; KeySetup=0; KeyUp=0; InitFlag=0;
}
}
}

void LengthSetup(void)
{
if(KeySetup)
{
KeySetup = 0;
SetupFlag = !SetupFlag;
}
if(KeyDown)
{
KeyDown = 0;
if(Length==45) Length = 255;
else Length--;
}
if(KeyUp)
{
KeyUp = 0;
if(Length>245) Length = 45;
else Length += 10;
}

if(!SetupFlag) { DispLCD(Length); }
if(ON_Flag) { ON_Flag=0; DispLCD(Length);}
if(OFF_Flag){ OFF_Flag=0; LCD_Off(); }
}

/* ===================== Start & End Motor ===================== */
void ScanStart(void)
{
if(Start==0)
{
delay(5);
if(!SetupFlag & !BusyFlag)
{
if(StartFlag) { SwitchStart = 1; }
}
}
}

void Start_End(void)
{
if (SwitchStart)
{
SwitchStart = 0;
StartFlag = 



                     0;
BusyFlag = 1;
Length_count = Length-35;
Length_count = 2*Length_count;
ResetFlag = 1;
_nop(); _nop();
Start_SendPaper();
}

if (InitFlag) { initial(); }

Hand = 1; Kee = Hand;
if(!Kee)
{
if(!SetupFlag)
{
_emi = 0; C_MT1 = 1;
StartFlag = 0;
while(!Kee)

_clrwdt(); Hand =1; Kee = Hand;
C_MT1 = 1;
C_MT2F = 0; C_MT2Z = 0;
}
C_MT1 = 0; _emi = 1;
CutFlag=1;
Cut_count=0;
ResetFlag = 1;
}
}
}

/* ======================= Display LCD ========================= */
void DispDigit(unsigned char Digit)
{
switch(Digit)
{
case 0: LCD_H = DIGIT[0]&0x0f; 
LCD_L = DIGIT[0]&0xf0; LCD_L >>= 4; 
break;
case 1: LCD_H = DIGIT[1]&0x0f; 
LCD_L = DIGIT[1]&0xf0; LCD_L >>= 4; 
break;
case 2: LCD_H = DIGIT[2]&0x0f; 
LCD_L = DIGIT[2]&0xf0; LCD_L >>= 4; 
break;
case 3: LCD_H = DIGIT[3]&0x0f; 
LCD_L = DIGIT[3]&0xf0; LCD_L >>= 4; 
break;
case 4: LCD_H = DIGIT[4]&0x0f; 
LCD_L = DIGIT[4]&0xf0; LCD_L >>= 4; 
break;
case 5: LCD_H = DIGIT[5]&0x0f; 
LCD_L = DIGIT[5]&0xf0; LCD_L >>= 4; 
break;
case 6: LCD_H = DIGIT[6]&0x0f; 
LCD_L = DIGIT[6]&0xf0; LCD_L >>= 4; 
break;
case 7: LCD_H = DIGIT[7]&0x0f; 
LCD_L = DIGIT[7]&0xf0; LCD_L >>= 4; 
break;
case 8: LCD_H = DIGIT[8]&0x0f; 
LCD_L = DIGIT[8]&0xf0; LCD_L >>= 4; 
break;
case 9: LCD_H = DIGIT[9]&0x0f; 
LCD_L = DIGIT[9]&0xf0; LCD_L >>= 4; 
break;
default: LCD_H = 0x00; LCD_L = 0x00; break;
}
}

void DispLCD(unsigned char data)
{
unsigned char digit1,digit2,digit3,temp,i;
_bp = 0x01;
temp = data%100;
digit1 = data/100;
digit2 = temp/10;
digit3 = temp%10;

DispDigit(digit1);
LCD[0] = LCD_H; LCD[1] = LCD_L;
DispDigit(digit2);
LCD[2] = LCD_H; LCD[3] = LCD_L;
DispDigit(digit3);
LCD[4] = LCD_H; LCD[5] = LCD_L;
for(i=8;i<20;i++){ LCD[i] = 0x00; }
}
void LCD_Off(void)
{
unsigned char i;
_bp = 0x01;
for(i=0;i<18;i++){ LCD[i] = 0x00; }
}

/* ==================== Interrupt Processor ==================== */
void INT0_isr(void)
{
dat0 = PulseInput;
if(!dat0)
{ Length_count--;
if(Length_count==0)
{
Stop_SendPaper();
if(ResetFlag)

CutFlag=1; // 初始化切紙電機(jī)
Cut_count=0; 
}
else
{
Stop_count = 2000; //2000
StopFlag = 1; 
if(Start) { StartFlag = 1; }
else      { StartFlag = 0; }
}
}
}
}

void INT1_isr(void)
{
//  dat1 = End;
//  if(!dat1 && Cut_count>800)
if(Cut_count>800)
{
Stop_CutPaper();
_nop(); _nop();
_eei1 = 0;
CutFlag = 0;
Cut_count = 0;
if(ResetFlag)
{
Length_count = INIT_LENGTH;
ResetFlag = 0;
ResendFlag = 1;
ResendCount = 2000; //500
}
else
{ Stop_count = 2000; StopFlag = 1; } //2000
}
}

void Time



                     r0_isr(void)
{
if(SetupFlag) // LCD setup
{
LCD_count++;
if(LCD_count==600) { ON_Flag = 1; }
else if(LCD_count==2400)
{ LCD_count=0; OFF_Flag=1; }
}

if(StopFlag)
{
Stop_count--;
if(Stop_count==0)
{ StopFlag=0; BusyFlag=0; }
}

if(ResendFlag)
{
ResendCount--;
if(ResendCount==0) 
{
Start_SendPaper();
ResendFlag = 0;
}
}

if(CutFlag) {  Cut_count++; }

if(Cut_count==1000) //800
{  
Start_CutPaper();
_eei1 = 1;
}
else if(Cut_count==1010) //810
{  
Start_CutPaper();
_eei1 = 1;
}
else if (Cut_count==5000) //5000
{ Stop_CutPaper(); }
else if (Cut_count==5500) //5500
{
ResetFlag = 0;
_eei1 = 1;
_nop(); _nop();
Exit_CutPaper();
}
else if (Cut_count==9500) //9500
{
Cut_count = 0;
ResetFlag = 0;
BusyFlag = 0;
Stop_CutPaper();
_nop(); _nop();
_eei1 = 0;
}
}
/* =========================== END ============================= */



【責(zé)任編輯】: 晶拓液晶

版權(quán)所有:http:// m.djtvv.com轉(zhuǎn)載請(qǐng)注明出處,違者本網(wǎng)將依法追究責(zé)任。

推薦資訊
背光板

液晶屏背光板的分類及知識(shí)點(diǎn)

背光板是提供LCD顯示器產(chǎn)品中一個(gè)背面光源的光學(xué)組件。由于液晶玻璃本身不具發(fā)光特性,因此根據(jù)需要會(huì)在液晶玻璃后面加上一個(gè)發(fā)光源,即背光板。應(yīng)用范圍遍及醫(yī)療,美容,儀器儀表,車載設(shè)備,工業(yè)設(shè)備、銀行終端、辦公自動(dòng)化、通訊、電子玩具及消費(fèi)...
2019-10-12
?VA彩屏液晶屏應(yīng)用眼部按摩儀

?VA彩屏液晶屏應(yīng)用眼部按摩儀

眼部按摩儀液晶顯示屏,VA屏,集美觀、實(shí)用于一體...
2019-04-19
VA彩屏液晶屏應(yīng)用于電動(dòng)車儀表

VA彩屏液晶屏應(yīng)用于電動(dòng)車儀表

電動(dòng)車儀表盤,VA彩屏,集美觀、實(shí)用于一體...
2019-04-19

咨詢熱線

13862038982