// Add.
{ case '+' : if ((currtoken == '=' ) || ((lastpress >= 0x30) && (lastpress <=0x39)))
{ lvalue += rvalue;
result = calc_chkerror(lvalue);
}
else本文来自辣.文,论-文·网原文请找腾讯324,9114
{ result = SLEEP; } break;
// Subtract.
case '-' : if ((currtoken == '=' ) || ((lastpress >= 0x30) && (lastpress <=0x39)))
{ lvalue -= rvalue;
result = calc_chkerror(lvalue);
}
else
{ result = SLEEP;} break;
// Multiply.
case '*' : if ((currtoken == '=' ) || ((lastpress >= 0x30) && (lastpress <=0x39)))
{ lvalue *= rvalue;
result = calc_chkerror(lvalue);
}
else
{ result = SLEEP;} break;
// Divide.
case '/' : if ((currtoken == '=' ) || ((lastpress >= 0x30) && (lastpress <=0x39)))
{ if (rvalue)
{ lvalue /= rvalue;
result = calc_chkerror(lvalue);
}
else
{ result = ERROR;}
}
else
{ result = SLEEP;} break;
// Cancel.
case 'C' : lvalue = 0;
rvalue = 0;
currtoken = '0';
lasttoken = '0';
result = OK; break;
default : result = SLEEP;
}
calc_output(result); }
上一页 [1] [2] [3] [4] 下一页
单片机滚动液晶电子钟设计源代码 第3页下载如图片无法显示或论文不完整,请联系qq752018766