【www.arisingsemi.com--IT认证】

c语言flag
#include  #include#include #include
#define uchar unsigned char #define uint unsigned int
sbit Key1 = P2^3;
sbit Key2 = P2^2;
sbit Key3 = P2^1;
sbit Key4 = P2^0;
sbit BELL = P3^6;sbit CONNECT = P3^7;
unsigned int  Key1_flag = 0;unsigned int  Key2_flag = 0;unsigned int  Key3_flag = 0;unsigned int  Key4_flag = 0;unsigned char b;unsigned char code Num[21]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,                            0x90,0x40,0x79,0x24,0x30,0x19,0x12,0x02,0x78,0x00,                            0x10,0x89}; unsigned char code Disdigit[4] = {0x7F,0xBF,0xDF,0xEF};unsigned char Disbuf[4];
void delayms(uint t){ uint i; while(t--) {  /* 对于11.0592M时钟,约延时1ms */  for (i=0;i>4;Disbuf[3] = SBUF&0x0f;RI = 0;}else;    }}

51单片机串口通信C语言程序2
**************************************************************;    平凡单片机工作室;;功能:反复向主机送AA和55两个数;主机使用一个串口调试软件 设置 19200,n,8,1***************************************************************/
#include "reg51.h"#define uchar unsigned char#define uint  unsigned int

//延时程序//////////////////由Delay参数确定延迟时间*/
void mDelay(unsigned int Delay) { unsigned int i;for(;Delay>0;Delay--){ for(i=0;i

本文来源:http://www.arisingsemi.com/it/85776/