C程序 while (--a!=0)是什么意思void LCM1602_TestBusy(void){ LCM_Dat_Port = 0xFF; LCM1602_RS = 0; LCM1602_RW = 1; LCM1602_EN = 1; while (LCM1602_Busy); LCM1602_EN = 0;}void LCM1602_WriteCMD(uchar dat){ LCM1602_TestBusy(); LCM1602_RS =
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/26 10:06:03
C程序 while (--a!=0)是什么意思void LCM1602_TestBusy(void){ LCM_Dat_Port = 0xFF; LCM1602_RS = 0; LCM1602_RW = 1; LCM1602_EN = 1; while (LCM1602_Busy); LCM1602_EN = 0;}void LCM1602_WriteCMD(uchar dat){ LCM1602_TestBusy(); LCM1602_RS =
C程序 while (--a!=0)是什么意思
void LCM1602_TestBusy(void)
{
LCM_Dat_Port = 0xFF;
LCM1602_RS = 0;
LCM1602_RW = 1;
LCM1602_EN = 1;
while (LCM1602_Busy);
LCM1602_EN = 0;
}
void LCM1602_WriteCMD(uchar dat)
{
LCM1602_TestBusy();
LCM1602_RS = 0;
LCM1602_RW = 0;
LCM_Dat_Port = dat;
LCM1602_EN = 1;
LCM1602_EN = 0;
}
void LCM1602_WriteDATA(uchar dat)
{
LCM1602_TestBusy();
LCM1602_RS = 1;
LCM1602_RW = 0;
LCM_Dat_Port = dat;
LCM1602_EN = 1;
LCM1602_EN = 0;
}
void LCM1602_init()
{
LCM1602_WriteCMD(0x38);
LCM1602_WriteCMD(0x0c);
LCM1602_WriteCMD(0x06);
LCM1602_WriteCMD(0x01);
}void LCD_set_xy(unsigned char x,unsigned char y)
{
unsigned char address;
if(y == LINE1)
address = LINE1_HEAD + x;
else
address = LINE2_HEAD + x;
LCM1602_WriteCMD(address);
}
void LCD_write_char( unsigned x,unsigned char y,unsigned char dat)
{
LCD_set_xy(x,y);
LCM1602_WriteDATA(dat);
}
帮我翻译一下,发到我邮箱[email protected] 谢谢
C程序 while (--a!=0)是什么意思void LCM1602_TestBusy(void){ LCM_Dat_Port = 0xFF; LCM1602_RS = 0; LCM1602_RW = 1; LCM1602_EN = 1; while (LCM1602_Busy); LCM1602_EN = 0;}void LCM1602_WriteCMD(uchar dat){ LCM1602_TestBusy(); LCM1602_RS =
;=c)中的&&的
下面是我在VC6中实际编译的程序帮助你理解.
#include <iostream>
using namespace std;
int main()
{
int a=0;
int b=0;
int c=0;
cout<<(a&&b<=c)<<endl;
return 0;
}
这个输出结果是0
很显然,如果是先计算&&的话,a&&b结果是0,它是<=c的,那么结果该为1.但是程序的结果是显示0,所以&&的优先级肯定不会大于<=.
上面是通过实际例子来帮助理解,而理论上的运算顺序我给你总结了最好记得一点:就是&& ||这两个逻辑运算符的优先级是很低的,比它们低的只有三种情况,一是?:(If Then),二是+=,-=,*=...此类运算符,三是逗号,分号,这些用于分割语句的运算符.其他的运算符优先级全部高于逻辑运算符.
这样可以记住了吧.