CT107D-按键的使用(中断法)
#include <reg52.h> int main() { IE|=0x85; TCON|=0x05; while(1); return 0; } void key_32(void) interrupt 0 { P2=(P2&0x1f)|0x80; P0=0x00; P2&=0x1f; } void key_33(void) interrupt 2 { P2=(P2&0x1f)|0x80; P0=0xff; P2&=0x1f; }
#include <reg52.h> int main() { IE|=0x85; TCON|=0x05; while(1); return 0; } void key_32(void) interrupt 0 { P2=(P2&0x1f)|0x80; P0=0x00; P2&=0x1f; } void key_33(void) interrupt 2 { P2=(P2&0x1f)|0x80; P0=0xff; P2&=0x1f; }
使用官方的ds1302.h和ds1302.c,下方有核心代码讲解main.c#include<reg52.h> #include<intrins.h> #include<ds1302.h> typedef unsigned char&nb...