|
/*--------------------------------------
Calculator progarm V1.0
MCU STC89C52RC XAL 12MHz
Build by Gavin Hu, 2007.11.23
--------------------------------------*/
#include
//
#define uchar unsigned char
#define uint unsigned int
#define ulong unsigned long
#define MAX_NUM 99999992.0
#define MIN_NUM -9999992.0
sbit BUZZ=P3^7;
uchar dec_flag;
void delay(uint);
void display(uchar*);
uchar key_scan(uint);
uchar add_number(uchar*,uchar);
float str2float(uchar*);
uchar float2str(uchar*,float);
float calcu(float,float,uchar);
void err_sound(void);
/*--------------------------------------
main function
--------------------------------------*/
void main(void)
{
uchar kk,mm,err,lk,d1ok,ec;
uchar dispram[9];
float d1,d2;
err=0;
d1ok=0;
ec=0;
mm=0;
dec_flag=0;
d1=0.0;
d2=0.0;
float2str(dispram,d1);
BUZZ=0;
for (kk=10;kk;kk--) display(dispram);
BUZZ=1;
while (!err)
{
display(dispram);
kk=key_scan(((uint)(P3) |
|