I have connected two Arduino boards with SPI Communication. Those two boards are mutually responding. Now I want to send multiple bytes from master to slave and slave to master.
Thanks in advance.
I have connected two Arduino boards with SPI Communication. Those two boards are mutually responding. Now I want to send multiple bytes from master to slave and slave to master.
Thanks in advance.
Take the slave select LOW and do multiple SPI.transfer() calls, then take the slave select HIGH.
digitalWrite(slaveSelect,LOW);
firstreceiveByte = SPI.transfer(firstByte);
secondreceiveByte = SPI.transfer(secondByte);
thirdreceiveByte = SPI.transfer(thirdByte);
digitalWrite(slaveSelect,HIGH);