That said some very knowledgeable members can be a bit terse
i am making a custom code scanner using 2 rows of black and white the bottom row is black white black white etc it is 8 bit so 4 white 4 black...dude you do understand my sentences without capitals, like i said.
I really don't know what you are trying to do. You are doing an SPI.transfer in the middle of the ISR?You send back data to the master by assigning to SPDR in the interrupt service routine. No other way. What are you thinking?
if(c == 0x04) { digitalWrite(SS, LOW); SPI.transfer(dat[0]); SPI.transfer(dat[1]); digitalWrite(SS, HIGH); digitalWrite(SS, LOW); SPI.transfer(dat[2]); SPI.transfer(dat[3]); digitalWrite(SS, HIGH); digitalWrite(SS, LOW); SPI.transfer(dat[4]); SPI.transfer(dat[5]); digitalWrite(SS, HIGH); } else if(c == 0x06) { digitalWrite(SS, LOW); SPI.transfer(dat[6]); SPI.transfer(dat[7]); digitalWrite(SS, HIGH); digitalWrite(SS, LOW); SPI.transfer(dat[8]); SPI.transfer(dat[9]); digitalWrite(SS, HIGH); digitalWrite(SS, LOW); SPI.transfer(dat[10]); SPI.transfer(dat[11]); digitalWrite(SS, HIGH); }