Go Down

Topic: Programming of Arduino Uno in slave mode (Read 3155 times) previous topic - next topic

vamshi97

Hello. In my application I have selected Arduino Due to transfer data (24-bit) to slave device named LMX2595. So, for experimental purpose I want to configure Arduino Due in Master mode and Arduino Uno in Slave mode. I have written the code for master which is below and now at the slave side I just want to see the data in serial monitor.


Can anyone help me with the code at the slave side just to display data in serial monitor.


Master code :


#include <SPI.h>

SPISettings mySettting(125000, MSBFIRST, SPI_MODE0);
const uint8_t ss = 10;

void setup() {
  pinMode(ss, OUTPUT);

  SPI.begin();

  digitalWrite(ss, LOW);
  SPI.beginTransaction(mySettting);
  SPI.transfer(0x00);
  SPI.transfer(0x25);
  SPI.transfer(0x1C);
  SPI.endTransaction();
  digitalWrite(ss, HIGH);
}

void loop() {
}



Any help will be greatly appreciated.


 

Go Up