switch(z)
{
case 0xee:PA_POWER_ON();wave01();PA_POWER_OFF();TX_LED();break;//按键01,输出波形01
case 0xde:PA_POWER_ON();wave02();PA_POWER_OFF();TX_LED();break;//按键02,输出波形02
case 0xbe:PA_POWER_ON();wave03();PA_POWER_OFF();TX_LED();break;//按键03,输出波形03
case 0x7e:PA_POWER_ON();wave04();PA_POWER_OFF();TX_LED();break;//按键04,输出波形04
case 0xed:PA_POWER_ON();wave05();PA_POWER_OFF();TX_LED();break;//按键05,输出波形05
case 0xdd:PA_POWER_ON();wave06();PA_POWER_OFF();TX_LED();break;//按键06,输出波形06
case 0xbd:PA_POWER_ON();wave07();PA_POWER_OFF();TX_LED();break;//按键07,输出波形07
case 0x7d:PA_POWER_ON();wave08();PA_POWER_OFF();TX_LED();break;//按键08,输出波形08
case 0xeb:PA_POWER_ON();wave09();PA_POWER_OFF();TX_LED();break;//按键09,输出波形09
case 0xdb:PA_POWER_ON();wave10();PA_POWER_OFF();TX_LED();break;//按键10,输出波形10
case 0xbb:PA_POWER_ON();wave11();PA_POWER_OFF();TX_LED();break;//按键11,输出波形11
case 0x7b:PA_POWER_ON();wave12();PA_POWER_OFF();TX_LED();break;//按键12,输出波形12
case 0xe7:PA_POWER_ON();wave13();PA_POWER_OFF();TX_LED();break;//按键13,输出波形13
case 0xd7:PA_POWER_ON();wave14();PA_POWER_OFF();TX_LED();break;//按键14,输出波形14
case 0xb7:PA_POWER_ON();wave15();PA_POWER_OFF();TX_LED();break;//按键15,输出波形15
case 0x77:PA_POWER_ON();wave16();PA_POWER_OFF();TX_LED();break;//按键16,输出波形16
default:;
}
}
void main()
{ init();//上电初始化
key_scan();
}
以下为C程序:
#include
#include
#define uchar unsigned char
#define uint unsigned int
switch(z)
{
case 0xee:PA_POWER_ON();wave01();PA_POWER_OFF();TX_LED();break;//按键01,输出波形01
case 0xde:PA_POWER_ON();wave02();PA_POWER_OFF();TX_LED();break;//按键02,输出波形02
case 0xbe:PA_POWER_ON();wave03();PA_POWER_OFF();TX_LED();break;//按键03,输出波形03
case 0x7e:PA_POWER_ON();wave04();PA_POWER_OFF();TX_LED();break;//按键04,输出波形04
case 0xed:PA_POWER_ON();wave05();PA_POWER_OFF();TX_LED();break;//按键05,输出波形05
case 0xdd:PA_POWER_ON();wave06();PA_POWER_OFF();TX_LED();break;//按键06,输出波形06
case 0xbd:PA_POWER_ON();wave07();PA_POWER_OFF();TX_LED();break;//按键07,输出波形07
case 0x7d:PA_POWER_ON();wave08();PA_POWER_OFF();TX_LED();break;//按键08,输出波形08
case 0xeb:PA_POWER_ON();wave09();PA_POWER_OFF();TX_LED();break;//按键09,输出波形09
case 0xdb:PA_POWER_ON();wave10();PA_POWER_OFF();TX_LED();break;//按键10,输出波形10
case 0xbb:PA_POWER_ON();wave11();PA_POWER_OFF();TX_LED();break;//按键11,输出波形11
case 0x7b:PA_POWER_ON();wave12();PA_POWER_OFF();TX_LED();break;//按键12,输出波形12
case 0xe7:PA_POWER_ON();wave13();PA_POWER_OFF();TX_LED();break;//按键13,输出波形13
case 0xd7:PA_POWER_ON();wave14();PA_POWER_OFF();TX_LED();break;//按键14,输出波形14
case 0xb7:PA_POWER_ON();wave15();PA_POWER_OFF();TX_LED();break;//按键15,输出波形15
case 0x77:PA_POWER_ON();wave16();PA_POWER_OFF();TX_LED();break;//按键16,输出波形16
default:;
}
}