Embedded system Fun Blog
























































Find out all the best information, libraries and circuit about the latest Embedded systems.

Sunday 8 January 2012

MBED Snipet: Send a byte to a SPI slave and listen the response

.from: http://mbed.org/projects/libraries/svn/mbed/trunk/SPI.h

#include "mbed.h"

SPI device(p5, p6, p7); // mosi, miso, sclk
Serial pc(USBTX, USBRX);

int main() {
    int response = device.write(0xFF);
    pc.printf("%d\r\n", response);
}

No comments:

Post a Comment