在51单片机中,按一下按键1,执行一个程序功能1,按按键2,执行程序功能2
在51单片机中,按一下按键1,执行一个程序功能1,按按键2,执行程序功能2
日期:2017-05-18 11:41:16 人气:1
#include
#include
unsigned char fun,led1=0xfe,led2=0x55;
sbit key1=P1^0;
sbit key2=P1^1;
sbit key3=P1^2;
void t0isr() interrupt 1
{
TH0=(65536-60000)/256;
TL0=(65536-60000)%256;
switch(fun)
{
case 1:P0=led1;led=_crol_(led1,1);break;
case