Syntax
void setBitOrder(
    BitOrder bit_order
);
ContentsIndex
PreviousUpNext
SPIClass::setBitOrder Method
SPIClass Class | Example
Syntax
void setBitOrder(
    BitOrder bit_order
);
Description

Sets up the order of data transmission, which can be MSBFIRST (MSB first) or LSBFIRST (LSB first).

Parameters
Parameters 
Description 
BitOrder bit_order 
[IN] The data transmission order (MSBFIRST or LSBFIRST). 
Example
#include <SPI.h>
#define SS_PIN    10

void setup()
{
    pinMode(SS_PIN, OUTPUT);
    SPI.begin(); 
    SPI.setBitOrder(MSBFIRST); 
}
void loop()
{
    byte ret_val;
    digitalWrite(SS_PIN, LOW);
    ret_val = SPI.transfer(100);
    digitalWrite(SS_PIN, HIGH);
    delay(1000);
}
File

SPI.h

Class