SPI.write

Name
SPI.write - Transfer the desired byte over SPI. A byte transmission also implies the reception of one byte, the meaning of the received byte depends of the slave device.

Equivalent to SPI.transfer

Description

 * Since Beta X

Syntax
u8 data_in = SPI.write(u8 module, u8 data_out)

Example
A function to write a value in the register address to a SPI slave device:

void writeRegister(char address, char value) {    // take the chip select high to select: digitalWrite(chipSelectPin, LOW); SPI.write(SPI1, address); //Send register location SPI.write(SPI1, value);   //Send value to record into register // take the chip select high to de-select: digitalWrite(chipSelectPin, HIGH); }