#include <reg52.h> #include <stdio.h> #include <string.h> #define uchar unsigned char #define uint unsigned int #define isp_iap_byte_read 0x1 #define isp_iap_byte_program 0x2 #define isp_iap_sector_erase 0x3 #define wait_time 0x1
上传时间: 2016-05-18
上传用户:agent
很完整的51串口程序 包括如下: 串口中断服务程序,仅需做简单调用即可完成串口输入输出的处理 出入均设有缓冲区,大小可任意设置。 可供使用的函数名: char getbyte(void) 从接收缓冲区取一个byte,如不想等待则在调用前检测inbufsign是否为1。 getline(char idata *line, unsigned char n) 获取一行数据回车结束,必须定义最大输入字符数 putbyte(char c) 放入一个字节到发送缓冲区 putbytes(unsigned char *outplace,j) 放一串数据到发送缓冲区,自定义长度 putstring(unsigned char code *puts) 发送一个定义在程序存储区的字符串到串口 puthex(unsigned char c) 发送一个字节的hex码,分成两个字节发。 putchar(uchar c,uchar j) 输出一个无符号字符数的十进制表示,必须标示小数点的位置,自动删除前面无用的零 putint(uint ui,uchar j) 输出一个无符号整型数的十进制表示,必须标示小数点的位置,自动删除前面无用的零 delay(unsigned char d) 延时n x 100ns putinbuf(uchar c) 人工输入一个字符到输入缓冲区 CR 发送一个回车换行
上传时间: 2016-06-13
上传用户:epson850
功能:用msp430驱动1621芯片的段码液晶 作者:徐世龙(网名:清风徐徐) 说明:源创(调试绝对能用) ---------------------------------------------------- cs-----p65 wr-----p64 dat----p63 mcu----msp430f135 ------------------------------------------------------------*/ /*------------------------ 功能:延时 参数:uint y 返回:无 说明:无 -------------------------*/
上传时间: 2014-01-02
上传用户:kernaling
//1602液晶显示字屏为:TX-1C MCU GOTOYUNLONGDZ #include<reg52.h> #define uchar unsigned char #define uint unsigned int
标签: GOTOYUNLONGDZ unsigned include define
上传时间: 2014-11-14
上传用户:caiiicc
#include <stc12c2052AD.H>// 标准库的头文件 #include <intrins.h> #include <absacc.h> #define uchar unsigned char #define uint unsigned int
上传时间: 2016-08-29
上传用户:rocwangdp
基于单片机的10根线束线缆检测器的源程序 #pragma sfr #pragma DI #pragma EI #pragma NOP //#pragma interrupt INTTM010 isr_INTTM000 #pragma interrupt INTTM80 isr_INTTM80 //#pragma interrupt INTTMH1 isr_INTTMH1 #pragma section @@CNST OPT AT 80H const char OPTION=0x94 typedef unsigned char uchar typedef unsigned int uint //==PORT DEFINE== #define SEND1_P P4.1 #define SEND2_P P4.2 #define SEND3_P P4.3 #define SEND4_P P4.4 #define SEND5_P P4.5 #define SEND6_P P4.6 #define SEND7_P P4.7 #define SEND8_P P13.0 #define SEND9_P P2.3 #define SEND10_P P2.2
标签: pragma interrupt INTTM 010
上传时间: 2017-05-25
上传用户:sunjet
#include<reg51.h> #define uchar unsigned char #define uint unsigned int uint i,j; sbit dula=P2^6; sbit wela=P2^7; uchar code table[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d, 0x7d,0x07,0x7f,0x6f,0x77,0x7c, 0x39,0x5e,0x79,0x71}; void main() { j=0; i=0; TMOD=0X01; TH0=(65536-50000)/256; TL0=(65536-50000)%6; EA=1; ET0=1; TR0=1; while(1); } void time0() interrupt 1 { TH0=(65536-50000)/256; TL0=(65536-50000)%6; i++; if(i==15) { P0=table[j]; dula=1; dula=0; P0=0XC0; wela=1; wela=0; j++; i=0; if(j==16) { j=0; } } }
标签: 用定时器以间隔500MS在6位数码管上依次显示0、1、 2、3….C、D、E、F,重复。
上传时间: 2016-02-11
上传用户:娇纵Pamper
/**************************************************************** 外部晶振8M PA0~3:四位数码管的位选 PB0~7:数码管的8位段选 外部中断0用于计数 定时器0溢出中断的定时为1ms 说明 :检测到水流较小时,继电器延时1秒关闭 ******************************************************************/ #include<iom16v.h> #include<macros.h> #define uchar unsigned char #define uint unsigned int char led_7[10]={0x3F,0x06,0x5B,0x4F,0x66,0x6D,0x7D,0x07,0x7F,0x6F}; //数码管段选 char position[4]={0xfe,0xfd,0xfb,0xf7};//数码管位选 uint sumnum=0; //用于记录1000ms内进入中断的次数 uint time=0; //记录进入比较定时器0的次数 uint num=0; //记录1ms内进入中断的次数 uint count=0; //进入外部中断0的次数 uchar flag; uint sumnum1; //记录100ms内的数目 /***************************函数声明***************************/ void delay(); void display(uint m ); void init(); void init_0(); void init_2(); void _delay_us(uint l) { unsigned int i; for(i=0;i<l;i++) { asm("nop"); } } /**************************主函数***********************************/ void main() { init(); init_0(); init_2(); while(sumnum<5) { PORTD=0XBF; segdisplay(sumnum1); } while(1) { segdisplay(sumnum1); } } /*************************扫描数码管时的延时函数*********************/ void delay() { uchar i,j; for(i=6;i>0;i--) for(j=225;j>0;j--); } /************************数码管显示函数*****************************/ void segdisplay( int temp) { int seg[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f}; int temp1,temp2,temp3,temp4; temp1=temp/1000; temp2=(temp/100)%10; temp3=(temp/10)%10; temp4=temp%10; DDRB=0xff; DDRA|=0x0f; PORTA=~BIT(3); PORTB=seg[temp1]; _delay_us(100); PORTA=~BIT(2); PORTB=seg[temp2]; _delay_us(100); PORTA=~BIT(1); PORTB=seg[temp3]; _delay_us(100); PORTA=~BIT(0); PORTB=seg[temp4]; _delay_us(100); } /***********************管脚初始化函数*********************/ void init() { DDRD|=0X40; //PD4 设置为输出 PORTD=0XBF; DDRA=0XFF; DDRB=0XFF; PORTA=0XFF; PORTB=0XFF; } /***********************外部中断0初始化*********************/ void init_0() { MCUCR=0X02; //INT0为下降沿触发 GICR=0X40; //使能INT0中断 SREG=0X80; //使能总中断 } /**********************定时器2初始化***********************/ void init_2() { TCCR0=0x03; // 内部时钟,64 分频(8M/64=125KHz) TCNT0=0x83; //装初值 TIMSK=0x01; // 允许 T/C0溢出中断中断 } /***********************外部中断0子函数********************/ #pragma interrupt_handler int0_isr:2 void int0_isr(void) { count++; } /*********************定时计数器0溢出中断子函数*****************/ #pragma interrupt_handler int0_over:10 void int0_over(void) { TCNT0=0x83; //重装初值 if((time%100) == 0) sumnum1 = num; if(time == 1000) { sumnum=num; if(sumnum<10) { if((flag==1)&&(sumnum<10)) { PORTD=0XFF; flag=0; } flag++; } else PORTD=0XBF; num=0; time=0; } num+=count; count=0; ++time; }
标签: C语言
上传时间: 2016-03-09
上传用户:彦 yan
#include "stm8s103f.h" #include "LEDBL.h" #include "UART1.h" #include "LCD1621.h" //#include "KEY.h" #define uchar unsigned char #define uint unsigned int _Bool KEYC @PB_IDR:4;//COPY _Bool KEYP @PC_IDR:6;//POW uint ShowMode = 1;
标签: LED
上传时间: 2016-03-23
上传用户:wfbuewsf
#include "STC90.h" #include < intrins.h > #define uchar unsigned char #define uint unsigned int #define led_port P1 sbit IR_RE = P3^2; sbit led_r = P1^3; sbit led_g = P1^4; sbit led_b = P1^5; sbit led_wd = P1^7; sbit K1 =P3^0 ; //增加键 sbit K2 =P3^1 ; //减少键 sbit BEEP =P3^7 ; //蜂鸣器 uchar temp,temp1; bit k=0; //红外解码判断标志位,为0则为有效信号,为1则为无效 bit Flag2; uchar date[4]={0,0,0,0}; //date数组为存放地址原码,反码,数据原码,反码 uint lade_1,lade_2,lade_3,lade_4; uint num; uchar date_ram,ee_temp,ee_temp1; uchar WDT_NUM=0; uchar const dofly[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f};// 显示段码值01234567 uchar code seg[]={7,6,5,4,3,2,1,0};//分别对应相应的数码管点亮,即位码 unsigned long disp_date; void fade(); void fade1(); /*************************** 看门狗子程序*************************/ void watchdog_timer() { if(WDT_NUM==5) { WDT_NUM=0; led_wd=!led_wd; } WDT_NUM++; WDT_CONTR=0x3f; } /******************************************************************/ void delay(unsigned int cnt) { while(--cnt); } /*--------------------------延时1ms程子程序-----------------------*/ void delay_1ms(uint z) { uint x,y; for(x=z;x>0;x--) for(y=126;y>0;y--); } /*--------------------------延时1ms程子程序-----------------------*/ delay1000() { uchar i,j; i=5; do{j=95; do{j--;} while(j); i--; } while(i); } /*---------------------------延时882us子程序-----------------------*/ delay882() { uchar i,j; i=6; do{j=71; do{j--;} while(j); i--; }while(i); } /*--------------------------延时2400us程子程序-----------------------*/ delay2400() { uchar i,j; i=5; do{j=237; do{j--;} while(j); i--; }while(i); } /**********************************************************************/ /* void display() { uchar i; for(i=0;i<8;i++) { P0=dofly[disp_date%10];//取显示数据,段码 P2=seg[i]; //取位码 delay_1ms(1); disp_date/=10; } } */ /*********************************************************************/ uchar EEPROM_read(uint addr)//EEPROM字节读 { ISP_CONTR=0x83; //系统时钟<12M时,对ISP_CONTR寄存器设置的值,本电路为11.0592M ISP_CMD=1; //字节读 ISP_ADDRH=(addr&0xff00)>>8; ISP_ADDRL=addr&0x00ff; ISP_TRIG=0x46; ISP_TRIG=0xb9; _nop_(); _nop_(); return ISP_DATA; } //-------------------------------------------------------------------- void EEPROM_write(uint addr,uchar dat)//EEPROM字节写 { ISP_CONTR=0x83; //系统时钟<12M时,对ISP_CONTR寄存器设置的值,本电路为11.0592M ISP_CMD=2; //字节编程 ISP_ADDRH=(addr&0xff00)>>8; ISP_ADDRL=addr&0x00ff; ISP_DATA=dat; ISP_TRIG=0x46; ISP_TRIG=0xb9; _nop_(); _nop_(); } //-------------------------------------------------------------------- void EEPROM_ERASE(uint addr)//EEPROM扇区擦除 { ISP_CONTR=0x83; //系统时钟<12M时,对ISP_CONTR寄存器设置的值,本电路为11.0592M ISP_CMD=3; //扇区擦除 ISP_ADDRH=(addr&0xff00)>>8; ISP_ADDRL=addr&0x00ff; ISP_TRIG=0x46; ISP_TRIG=0xb9; _nop_(); _nop_(); } //************************************************************** /*----------------------------------------------------------*/ /*-----------------------红外解码程序(核心)-----------------*/ /*----------------------------------------------------------*/ void IR_decode() { uchar i,j; while(IR_RE==0); delay2400(); if(IR_RE==1) //延时2.4ms后如果是高电平则是新码 { delay1000(); delay1000(); for(i=0;i<4;i++) { for(j=0;j<8;j++) { while(IR_RE==0); //等待地址码第1位高电平到来 delay882(); //延时882us判断此时引脚电平 ///CY=IR_RE; if(IR_RE==0) { date[i]>>=1; date[i]=date[i]|0x00; } else if(IR_RE==1) { delay1000(); date[i]>>=1; date[i]=date[i]|0x80; } } //1位数据接收结束 } //32位二进制码接收结束 } } /* void LED_PWM() { lade_2=num; //384 lade_4=num; //384 while(lade_2!=0&Flag2==1) { for(lade_3=512;lade_3>lade_4;lade_3--) //512 { led_port=0x00; delay(1); } lade_3=512; //512 lade_4--; for(lade_1=0;lade_1<lade_2;lade_1++) { led_port=0x38; //c7 delay(1); } lade_1=0; lade_2--; if(temp!=0x0c&Flag2==1) { lade_2=0; } lade_2=num; //384 lade_4=num; //384 } } */ void calc() { EEPROM_read(0x2000); ee_temp1=ISP_DATA; ee_temp=ee_temp1&0x0f; //************************************* 1 /* if(date[3]==0xff&Flag2==1) { if(num>=20) { num=num-80; } //else num=1; LED_PWM(); } if(date[3]==0xfe&Flag2==1) { if(num<=500) { num=num+80; } // else num=511; LED_PWM(); } if(ee_temp1==0xfd) { led_port=0x00; watchdog_timer(); } if(ee_temp1==0xfc) { led_port=0x00; led_r=1; led_g=1; led_b=1; watchdog_timer(); } */ //********************************************** 2 if(ee_temp1==0xfb) { led_port=0x00; led_r=1; watchdog_timer(); } if(ee_temp1==0xfa) { led_port=0x00; led_g=1; watchdog_timer(); } if(ee_temp1==0xf9) { led_port=0x00; led_b=1; watchdog_timer(); } if(ee_temp1==0xf8) { led_port=0x00; led_r=1; led_g=1; led_b=1; watchdog_timer(); } //************************************** 3 if(ee_temp1==0xf7) { uint fade_1,fade_2,fade_3,fade_4; fade_2=448; //384 fade_4=448; //384 while(fade_2!=0&ee_temp==0x07) { for(fade_3=512;fade_3>fade_4;fade_3--) //512 { led_port=0x10; delay(1); } fade_3=512; //512 fade_4--; watchdog_timer(); for(fade_1=0;fade_1<fade_2;fade_1++) { led_port=0x08; delay(1); } fade_1=0; fade_2--; if(ee_temp!=0x07) { fade_2=0; } watchdog_timer(); fade_2=448; //384 fade_4=448; //384 } } if(ee_temp1==0xf6) { uint fade_1,fade_2,fade_3,fade_4; fade_2=448; //384 fade_4=448; //384 while(fade_2!=0&ee_temp==0x06) { for(fade_3=512;fade_3>fade_4;fade_3--) //512 { led_port=0x20; delay(1); } fade_3=512; //512 fade_4--; watchdog_timer(); for(fade_1=0;fade_1<fade_2;fade_1++) { led_port=0x10; delay(1); } fade_1=0; fade_2--; if(ee_temp!=0x06) { fade_2=0; } watchdog_timer(); fade_2=448; //384 fade_4=448; //384 } } if(ee_temp1==0xf5) { uint fade_1,fade_2,fade_3,fade_4; fade_2=448; //384 fade_4=448; //384 while(fade_2!=0&ee_temp==0x05) { for(fade_3=512;fade_3>fade_4;fade_3--) //512 { led_port=0x08; delay(1); } fade_3=512; //512 fade_4--; watchdog_timer(); for(fade_1=0;fade_1<fade_2;fade_1++) { led_port=0x20; delay(1); } fade_1=0; fade_2--; if(ee_temp!=0x05) { fade_2=0; } watchdog_timer(); fade_2=448; //384 fade_4=448; //384 } } if(ee_temp1==0xf4) { while(ee_temp==4) { led_port=0x00; led_r=1; delay_1ms(200); led_port=0x00; led_r=1; led_g=1; delay_1ms(200); led_port=0x00; led_g=1; delay_1ms(200); watchdog_timer(); led_port=0x00; led_g=1; led_b=1; delay_1ms(200); led_port=0x00; led_b=1; delay_1ms(200); led_port=0x00; led_b=1; led_r=1; delay_1ms(200); watchdog_timer(); } } //************************************** 4 if(ee_temp1==0xf3) { uint fade_1,fade_2,fade_3,fade_4; fade_2=416; //384 fade_4=416; //384 while(fade_2!=0&ee_temp==0x03) { for(fade_3=512;fade_3>fade_4;fade_3--) //512 { led_port=0x10; delay(1); } fade_3=512; //512 fade_4--; watchdog_timer(); for(fade_1=0;fade_1<fade_2;fade_1++) { led_port=0x08; delay(1); } fade_1=0; fade_2--; if(ee_temp!=0x03) { fade_2=0; } watchdog_timer(); fade_2=416; //384 fade_4=416; //384 } } if(ee_temp1==0xf2) { uint fade_1,fade_2,fade_3,fade_4; fade_2=384; //384 fade_4=384; //384 while(fade_2!=0&ee_temp==0x02) { for(fade_3=512;fade_3>fade_4;fade_3--) //512 { led_port=0x20; delay(1); } fade_3=512; //512 fade_4--; watchdog_timer(); for(fade_1=0;fade_1<fade_2;fade_1++) { led_port=0x10; delay(1); } fade_1=0; fade_2--; if(ee_temp!=0x02) { fade_2=0; } watchdog_timer(); fade_2=384; //384 fade_4=384; //384 } } if(ee_temp1==0xf1) { uint fade_1,fade_2,fade_3,fade_4; fade_2=348; //384 fade_4=348; //384 while(fade_2!=0&ee_temp==0x01) { for(fade_3=512;fade_3>fade_4;fade_3--) //512 { led_port=0x08; delay(1); } fade_3=512; //512 fade_4--; watchdog_timer(); for(fade_1=0;fade_1<fade_2;fade_1++) { led_port=0x20; delay(1); } fade_1=0; fade_2--; if(ee_temp!=0x01) { fade_2=0; } watchdog_timer(); fade_2=348; //384 fade_4=348; //384 } } if(ee_temp1==0xf0) { while(ee_temp==0) { led_port=0x00; led_r=1; delay_1ms(500); watchdog_timer(); led_port=0x00; led_g=1; delay_1ms(500); led_port=0x00; led_b=1; delay_1ms(500); watchdog_timer(); } } //******************************************** 5 if(ee_temp1==0xef) { uint fade_1,fade_2,fade_3,fade_4; fade_2=384; //384 fade_4=384; //384 while(fade_2!=0&ee_temp==0x0f) { for(fade_3=512;fade_3>fade_4;fade_3--) //512 { led_port=0x10; delay(1); } fade_3=512; //512 fade_4--; watchdog_timer(); for(fade_1=0;fade_1<fade_2;fade_1++) { led_port=0x08; delay(1); } fade_1=0; fade_2--; if(ee_temp!=0x0f) { fade_2=0; } watchdog_timer(); fade_2=384; //384 fade_4=384; //384 } } if(ee_temp1==0xee) { uint fade_1,fade_2,fade_3,fade_4; fade_2=320; //384 fade_4=320; //384 while(fade_2!=0&ee_temp==0x0e) { for(fade_3=512;fade_3>fade_4;fade_3--) //512 { led_port=0x20; delay(1); } fade_3=512; //512 fade_4--; watchdog_timer(); for(fade_1=0;fade_1<fade_2;fade_1++) { led_port=0x10; delay(1); } fade_1=0; fade_2--; if(ee_temp!=0x0e) { fade_2=0; } watchdog_timer(); fade_2=320; //384 fade_4=320; //384 } } if(ee_temp1==0xed) { uint fade_1,fade_2,fade_3,fade_4; fade_2=320; //384 fade_4=320; //384 while(fade_2!=0&ee_temp==0x0d) { for(fade_3=512;fade_3>fade_4;fade_3--) //512 { led_port=0x08; delay(1); } fade_3=512; //512 fade_4--; watchdog_timer(); for(fade_1=0;fade_1<fade_2;fade_1++) { led_port=0x20; delay(1); } fade_1=0; fade_2--; if(ee_temp!=0x0d) { fade_2=0; } watchdog_timer(); fade_2=320; //384 fade_4=320; //384 } } if(ee_temp1==0xec) fade(); //******************************************* 6 if(ee_temp1==0xeb) { led_port=0x00; led_r=1; led_g=1; watchdog_timer(); } if(ee_temp1==0xea) { led_port=0x00; //led_r=0; led_g=1; led_b=1; watchdog_timer(); } if(ee_temp1==0xe9) { led_port=0x00; led_r=1; //led_g=0; led_b=1; watchdog_timer(); } if(ee_temp1==0xe8) fade1(); } void fade() { // uchar i; uint fade_1,fade_2,fade_3,fade_4; fade_2=512; fade_4=511; while(fade_2!=0&ee_temp==0x0c) { for(fade_3=512;fade_3>fade_4;fade_3--) { led_port=0x10; delay(1); } fade_3=512; fade_4--; watchdog_timer(); for(fade_1=0;fade_1<fade_2;fade_1++) { led_port=0x08; delay(1); } fade_1=0; fade_2--; if(ee_temp!=0x0c) { fade_2=0; } } watchdog_timer(); fade_2=512; fade_4=511; while(fade_2!=0&ee_temp==0x0c) { if(ee_temp!=0x0c) { fade_2=0; } for(fade_3=512;fade_3>fade_4;fade_3--) { led_port=0x20; delay(1); // watchdog_timer(); } fade_3=512; fade_4--; watchdog_timer(); for(fade_1=0;fade_1<fade_2;fade_1++) { led_port=0x10; delay(1); // watchdog_timer(); } fade_1=0; fade_2--; } watchdog_timer(); fade_2=512; fade_4=511; while(fade_2!=0&ee_temp==0x0c) { if(ee_temp!=0x0c) { fade_2=0; } for(fade_3=512;fade_3>fade_4;fade_3--) { led_port=0x08; delay(1); watchdog_timer(); } fade_3=512; fade_4--; watchdog_timer(); for(fade_1=0;fade_1<fade_2;fade_1++) { led_port=0x20; delay(1); watchdog_timer(); } fade_1=0; fade_2--; } watchdog_timer(); } void fade1() { // uchar i; uint fade_1,fade_2,fade_3,fade_4; fade_2=128; fade_4=127; while(fade_2!=0&ee_temp==0x08) { for(fade_3=128;fade_3>fade_4;fade_3--) { led_port=0x10; delay(1); } fade_3=128; fade_4--; for(fade_1=0;fade_1<fade_2;fade_1++) { led_port=0x08; delay(1); } fade_1=0; fade_2--; if(ee_temp!=0x08) { fade_2=0; } } watchdog_timer(); fade_2=128; fade_4=127; while(fade_2!=0&ee_temp==0x08) { if(ee_temp!=0x08) { fade_2=0; } for(fade_3=128;fade_3>fade_4;fade_3--) { led_port=0x20; delay(1); } fade_3=128; fade_4--; for(fade_1=0;fade_1<fade_2;fade_1++) { led_port=0x10; delay(1); } fade_1=0; fade_2--; } watchdog_timer(); fade_2=128; fade_4=127; while(fade_2!=0&ee_temp==0x08) { if(ee_temp!=0x08) { fade_2=0; } for(fade_3=128;fade_3>fade_4;fade_3--) { led_port=0x08; delay(1); } fade_3=128; fade_4--; for(fade_1=0;fade_1<fade_2;fade_1++) { led_port=0x20; delay(1); } fade_1=0; fade_2--; } watchdog_timer(); } void init() { led_port=0x00; /* led_r=1; delay_1ms(500); led_port=0x00; led_g=1; delay_1ms(500); led_port=0x00; led_b=1; delay_1ms(500); led_port=0x00; */ delay_1ms(2); WDT_CONTR=0x3f; delay_1ms(500); } //******************************** void main() { init(); Flag2=0; SP=0x60; //堆栈指针 EX0=1; //允许外部中断0,用于检测红外遥控器按键 EA=1; num=255; while(1) { calc(); } } //******************************************************************** /*------------------------外部中断0程序-------------------------*/ /*------------------主要用于处理红外遥控键值--------------------*/ void int0() interrupt 0 { uchar i; Flag2=0; /////// k=0; EX0=0; //检测到有效信号关中断,防止干扰 for(i=0;i<4;i++) { delay1000(); if(IR_RE==1){k=1;} //刚开始为9ms的引导码. } led_port=0x00; if(k==0) { IR_decode(); //如果接收到的是有效信号,则调用解码程序 if(date[3]>=0xe8) { if(date[3]<=0xfb) { temp1=date[3]; EEPROM_ERASE(0x2000); //STC_EEROM_0X2000 temp1 EEPROM_write(0x2000,temp1); EEPROM_read(0x2000); ee_temp1=ISP_DATA; ee_temp=ee_temp1&0x0f; /* temp=date[3]&0x0f; EEPROM_ERASE(0x2004); //STC_EEROM_0X2004 temp EEPROM_write(0x2004,temp); */ } else { EEPROM_read(0x2000); ee_temp1=ISP_DATA; ee_temp=ee_temp1&0x0f; } } delay2400(); delay2400(); delay2400(); delay_1ms(500); } EX0=1; //开外部中断,允许新的遥控按键 }
上传时间: 2016-07-02
上传用户:184890962