So i had this code for a 4 channel dipswitch
[int bin(int num, ...){ //esto nos da el valor binario para el estado de los pines, recibe el numero de pines y los pines respectivos como parametros. Si este esta en LOW nos da 0, si esta en HIGH devuelve 1
int total = 0;
va_list val;
va_start(val, num);
for(;num > 0; num--){
if (!(digitalRead(va_arg(val, int))) )
total += dip(2, num-1);
}
va_end(val);
return total;
}
int dip(int base, int exp){ //Esto se usa para saber la cantidad de combinaciones que tendremos, al ser un dip de 4 esto sera 2^4, por eso necesitamos la base y el exponente
int res = 1;
for(;exp > 0; exp--)
res *= base;
return res;
}
comb = bin(4, 13, 12, 10, 9);/]
now i want to use a processing interface instead of my dip, i had 4 button on processing, all of them can be activated by cliking on them, i wanted to know if there is a way to modify my arduino code to work with my interface or if there is another way to use processing as my dip, thanks