Hello!!!.., Greetings to all, I comment that I am new in the use of Photon, I have a project with SPI communication with 2 photon, but I have several attempts and I can not establish communication, I could support myself to check if I have any errors in the code, Thank you very much … greetings.:
===Master===
void setup()
{
pinMode(SS,OUTPUT);
digitalWrite(SS,HIGH);
Serial.begin(9600);
SPI.begin(SPI_MODE_MASTER,SS);
SPI.setClockSpeed(1, MHZ);
SPI.setBitOrder(MSBFIRST);
SPI.setDataMode(SPI_MODE3);
}
void loop()
{
digitalWrite(SS,LOW);
byte sendData = 0x05;
SPI.transfer(sendData);
digitalWrite(SS, HIGH);
Serial.print("\nEnviado a Slave=");
Serial.print(sendData);
delay(500);
}
===SLAVE===
void setup()
{
Serial.begin(9600);
SPI.begin(SPI_MODE_SLAVE,SS);
}
void loop()
{
byte recvData;
recvData = SPI.transfer(0x00);
Serial.print("\nRecibido de Maestro=");
Serial.print(recvData);
delay(500);
}
Thanks…