1.按下亮,松开不亮
#include "reg52.h"sbit key1 = P2^1;
sbit ledone = P3^7;
void main()
{//while(1){if(key1 == 0){ //ledone = 0;break;}else if(key1 ==1){ledone = 1;break;}}
}
1.按下亮,松开不亮
#include "reg52.h"sbit key1 = P2^1;
sbit ledone = P3^7;
void main()
{//while(1){if(key1 == 0){ //ledone = 0;break;}else if(key1 ==1){ledone = 1;break;}}
}