#include <reg52.h>
typedef unsigned int U16;
typedef unsigned char U8;
U8 num[]={0xC0,0xF9,0xA4,0xB0,0x99,0x92,0x82,0xF8,0x80,0x90,0x7F,0xFF};
sbit LED0=P1^0;
sbit LED1=P1^1;
sbit LED2=P1^2;
sbit LED3=P1^3;
sbit KeyIn4=P3^4;
U8 shuma[4]={0};
void delay()
{
U16 i=1000;
whil...
#include<reg52.h>
typedef unsigned char U8;
typedef unsigned int U16;
U16 x=0;
sbit S1 = P3^6;
sbit S2 = P3^7;
sbit led0=P1^3;
sbit led1=P1^2;
sbit led2=P1^1;
sbit led3=P1^0;
code U8 num[]={0xC0,0xF9,0xA4,0xB0,0x99,
0x92,0x82,0xF8,0x80,0x90};
U8 shuma[4]={0};
void delay()
{
...
#include <reg52.h>
typedef unsigned int U16;
typedef unsigned char U8;
U8 num[]={0xC0,0xF9,0xA4,0xB0,0x99,0x92,0x82,0xF8,0x80,0x90,0x7f,0xFF};
sbit LED3=P1^3;
sbit LED2=P1^2;
sbit LED1=P1^1;
sbit LED0=P1^0;
U8 shuma[4]={0};
void T0_Init()
{
TMOD=0x10;
TH1=0xFC;
TL1=0x18;
TR1=1...
#include <reg52.h> #include <reg52.h>
typedef unsigned int U16;
typedef unsigned char U8;
U8 num[]={0xC0,0xF9,0xA4,0xB0,0x99,0x92,
0x82,0xF8,0x80,0x90,0x7f,0xFF};
sbit LED3=P1^3;
sbit LED2=P1^2;
sbit LED1...
#include <reg52.h> #include <reg52.h>
typedef unsigned int U16;
typedef unsigned char U8;
U8 num[]={0xC0,0xF9,0xA4,0xB0,0x99,0x92,0x82,0xF8,0x80,0x90,0x7f,0xFF};
sbit LED3=P1^3;
sbit LED2=P1^2;
sbit LED1=P1^1;
sbit...
#include <reg52.h>
typedef unsigned int U16;
typedef unsigned char U8;
U8 num[]={0xC0,0xF9,0xA4,0xB0,0x99,0x92,0x82,0xF8,0x80,0x90,0X7F};
sbit LED1=P1^0;
sbit LED2=P1^1;
sbit LED3=P1^2;
sbit LED4=P1^3;
void TO_INIt()
{
U8 j=0,t=0,n=0;
TMOD=0x10;
TH1=0x3C;
TL1=0xB0;
TR1=1...
#include<stdio.h>
#include<stdlib.h>
#define WEIGHT 3.0e-23
#define CHAGE 950
int main()
{
float k;
printf("Please enter:");
scanf("%f,&k");
printf("%e\n,k * CHAGE /WEIGHT");
exit(0);
}