/* * This is a test program for universal16 with external Arduino. * Use with keyaki_namiki/led_ctrl/led_ctrl.ino * */ const int Rowpin[] = {4,5,7,8}; const int Colpin[] = {10,15,14,16}; const int Cols = (sizeof(Rowpin)/sizeof(Rowpin[0])); const int Rows = (sizeof(Colpin)/sizeof(Colpin[0])); bool beforeState[Rows][Cols]; bool currentState[Rows][Cols]; byte sendData,readData; /* data description * * 0b0000000 * _ matrix or renc * if matrix(0) * *_ press or release * **_ master or slave * ***__ matrix position (row) * *****__ matrix position (col) * *******0 blank * if renc(1) * *_ renc0 or renc1 * **_ button press or release * ***_ rotate (en/dis)able * ****_ rotate direction * *****000 blank */ void setup(){ Serial.begin(9600); Serial1.begin(115200); Serial1.write("hello!"); // while(!Serial); Serial.println("Started."); for(int i=0;i