Hi all
I am trying to communicate using SPI protocol between two arduino uno boards. I have writthen a very simple code to transfer a single character from master. The code is as following
#include <SPI.h>
#include "pins_arduino.h"
void setup (void)
{
}
void loop (void)
{
digitalWrite(SS, HIGH); // ensure SS stays high
SPI.begin ();
delay (5000); // 5 seconds delay to start logic analyser.
// enable Slave Select
digitalWrite(SS, LOW); // SS is pin 10
// send test string
SPI.transfer ( 'c');
// disable Slave Select
digitalWrite(SS, HIGH);
// turn SPI hardware off
SPI.end ();
while (1); //loop
}
Please correct the code if its not right. And I really want to know that how to recieve that character on arduino uno in slave mode. There is a command SPI.transfer() to send data on SPI where as I haven't seen any command to recieve it.
Thanks and regards
Moderator edit:
</mark> <mark>[code]</mark> <mark>
</mark> <mark>[/code]</mark> <mark>
tags added.