while(1)
{
key=keyscan();
switch(key) //通过SWITCH语句执行相应操作。
{
case 0x11: LEDport=0xfe;break;
case 0x12: LEDport=0xef;break;
case 0x14: LEDport=0xfb;break;
case 0x18: LEDport=0xf7;break;
case 0x21: LEDport=0xfd;break;
case 0x22: LEDport=0xdf;break;
case 0x24: LEDport=0xbf;break;
case 0x28: LEDport=0x7f;break;
}