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 00003 #define VALUE_SENT 0xFA 00004 00005 Serial pc(SERIAL_TX, SERIAL_RX); 00006 SPI spi(D11, D12, D13); 00007 00008 DigitalOut chipSelect(D10); 00009 00010 int main() 00011 { 00012 int masterVal = VALUE_SENT; 00013 chipSelect = 1; // Deselect device 00014 00015 spi.format(8,3); // Setup: bit data, high steady state clock, 2nd edge capture 00016 spi.frequency(1000000); //1MHz 00017 00018 chipSelect = 0; // Select device 00019 00020 spi.write(masterVal); 00021 00022 wait(2); 00023 chipSelect = 1; // Deselect device 00024 }
Generated on Sun Jul 17 2022 13:23:46 by
1.7.2