Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
main.cpp
00001 #include "mbed.h" 00002 Serial pc(USBTX, USBRX); 00003 DigitalOut myled(LED1); 00004 SPI spi(p11, p12, p13); //mosi, miso, sclk 00005 DigitalOut cs(p14); 00006 #define DTIME 0.005 00007 00008 int main() { 00009 spi.format(8,0); 00010 spi.frequency(1000000); 00011 int teste; 00012 teste=0xAA; 00013 while(1){ 00014 cs=0; 00015 wait(DTIME); 00016 int result = spi.write(teste); 00017 pc.printf("Send to Slave = %d\n\r", teste); 00018 pc.printf("Reply from Slave = %d\n\r", result); 00019 pc.printf("\n\r"); 00020 wait(DTIME); 00021 cs=1; 00022 wait(1); 00023 } 00024 }
Generated on Tue Nov 1 2022 05:08:27 by
1.7.2