欧美极品高清xxxxhd,国产日产欧美最新,无码AV国产东京热AV无码,国产精品人与动性XXX,国产传媒亚洲综合一区二区,四库影院永久国产精品,毛片免费免费高清视频,福利所导航夜趣136
標題:
display.h頭文件下載
[打印本頁]
作者:
das
時間:
2015-4-18 03:36
標題:
display.h頭文件下載
12864液晶顯示display.h基于msp430單片機頭文件代碼最后的復制代碼保存到電腦的方式實現下載:
uchar a=0,c=80;
uint dianya[11];
uchar dianliu[11];
//uchar key_value;
//uchar FLAG=0;
void display_voltage(unsigned int result_zz1)//顯示電壓
{ DisplayCgrom(0x90," ");
DisplayCgrom(0x90,"電壓: ");
unsigned char temp_value[6];
temp_value[0]=(result_zz1/1000)+0x30; //加(0x30)=48,‘0’,化int數字為char數字字符
temp_value[1]=(result_zz1%1000/100)+0x30;
temp_value[2]='.';
temp_value[3]=(result_zz1%1000/10%10)+0x30;
temp_value[4]=(result_zz1%10 )+0x30;
temp_value[5]=' ';
if(temp_value[0]==0)temp_value[0]=' ';
LCD_write_str(0x03,1,temp_value);
LCD_write_str(0x06,1,"v ");
dianya[a]=result_zz1;
}
void display_current(unsigned int result_zz1)//顯示電流
{
unsigned char temp_value[4];
temp_value[0]=(result_zz1/100)+0x30; //加(0x30)=48,‘0’,化int數字為char數字字符
temp_value[1]='.';
temp_value[2]=(result_zz1/10%10)+0x30;
temp_value[3]=(result_zz1%10 )+0x30;
LCD_write_str(0x04,0,temp_value);
LCD_write_str(0x06,0,"A ");
dianliu[a]=result_zz1;
}
void display_set(void)//設定電流
{
uchar b[4];
b[0]=(a/10)+0x30;
b[1]=(a%10)+0x30;
if(a/10==0)b[0]=' ';
b[2]=0+0x30;b[3]=0+0x30;
if(a==0){b[1]=' ';b[2]=' ';}
DisplayCgrom(0x88,"設定電流: ");
LCD_write_str(0x05,2,b);
LCD_write_str(0x07,2,"MA");
}
void display_caculate(void)//計算電源負載調整率
{ DisplayCgrom(0x98," ");
DisplayCgrom(0x98,"負載調整率:");
uchar d[4];
d[0]=c/100+0x30;
d[1]=c%100/10+0x30;
d[2]=c%100%10+0x30;
if(c/100==0)d[0]=':';
d[3]=' ';
LCD_write_str(0x05,3,d);
LCD_write_str(0x07,3," %");
}
//
void key_inint(void)
{ P1DIR=0X00;
P1IE=0X30;
P1IES=0X30;
P1IFG=0X00;
_EINT();
}
#pragma vector=PORT1_VECTOR
__interrupt void port1(void)
{
switch(P1IFG)
{
case 0x10:a++;delay_ms(1);break;
case 0x20:a--;delay_ms(1);break;
default:P1IFG=0X00;break;
}
P1IFG=0X00;
if(a>=11)a=0;
//caculate1();
}
/*uchar readkey(void)
{unsigned char shu;
shu=P1IN&0xf0;
if(shu!=0xf0)
{delay_ms(10);
if(shu!=0xf0)
{FLAG=1;
return shu;}
else return 0xf0;
}
else return 0xf0;
}
void seta()
{ FLAG=0;
a++;
if(a>10)a=1;
}
void setb()
{ FLAG=0;
a--;
if(a<1)a=10;
}
void key()
{unsigned key;
key=readkey();
switch(key)
{case 0xe0:seta();break;//設定電流比例
case 0xd0:setb();break;
case 0xb0:break;
case 0x70:break;
case 0xf0:break;
}
}
*/
復制代碼
作者:
shitao370481
時間:
2019-5-20 15:21
66666666
歡迎光臨 (http://www.raoushi.com/bbs/)
Powered by Discuz! X3.1