IO_Processing_Board_SPI_Master

Dependencies:   mbed

main.cpp

Committer:
rvasquez6089
Date:
2017-03-29
Revision:
0:c74a285fae38

File content as of revision 0:c74a285fae38:

#include "mbed.h"
 
SPI device(PE_14, PE_5, PE_12); //SPI(MOSI, MISO, SCLK);
DigitalOut MTR1_SSEL(PF_12);
Serial pc(SERIAL_TX, SERIAL_RX);
int main() {
    pc.baud(115200);
    pc.printf("The F746 is working \n\r");
    char i = 0;
    MTR1_SSEL = 1;
    pc.printf("Slave select is high");
    device.format(8,3);
    device.frequency(1000000);
    while(1) {
        MTR1_SSEL = 0;
        device.write(i);
        MTR1_SSEL = 1;
        pc.printf("The F7 is sending %c \n\r", i);
        i++;
        
        wait(0.1);
    }
}