Is there a way to shorten it D==1 && C==1 && B==0 && A==0 to just a name like Key1? as I have many different set of those that i wished to make
#include<xc.h>
#define Key1 (D==1 && C==1 && B==0 && A==0)
char K1[] = "Key 1 was pressed";
void main() {
unsigned char i;
while(DA==1){
if(Key1){
sendfunction(0b10000000);
for (i=0; K1[i]!=0; i++){
sendtext(K1[i]);
} //message
}//for loop
}
/*But if I put in this way, it works
and it will display "Key 1 was pressed"
*/
if((D==1 && C==1 && B==0 && A==0){
sendfunction(0b10000000);
for (i=0; K1[i]!=0; i++){
sendtext(K1[i]);
} //message
}//for loop