#include"mylib.h"
void setup() {
// put your setup code here, to run once:
myinit();
long num1 = getvalue();
if (op == 0)
{
scan();
}
delay(1000);
long num2 = getvalue();
long res = 0;
switch (op)
{
case (1):
res = num1 + num2;
break;
case (2):
res = num1 - num2;
break;
case (3):
res = num1 * num2;
break;
case (4):
res = num1 / num2;
break;
}
if (res>9999 || res<0)
{
volatile char* segdisp = 0x108;
volatile char* comcath = 0x22;
*comcath = 0x00;
*segdisp = 0x79;
}
else
{
loadres(res);
while(1)
display();
}
}
void loop() {
// put your main code here, to run repeatedly:
}