#include #include #define uchar unsigned char sbit button = P3^2; uchar press = 0; uchar luishui = 0xfe; void Delay(uchar z) { uchar x, y; for(x = z; x > 0; x--) for(y = 255; y > 0; y--); } void main() { IT0 = 1; EX0 = 1; EA = 1; while(1) { if(press == 1) P0 = 0xff; if(press == 0) { P0 = luishui; luishui = _crol_(luishui, 1); Delay(255); } } } X0_INT() interrupt 0 { press += 1; if(press == 2) press = 0; Delay(10); while(button == 0); }