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.
Dependencies: mbed
Diff: spi_master.cpp
- Revision:
- 0:50fdc77f2817
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/spi_master.cpp Mon Dec 14 00:59:26 2015 +0000 @@ -0,0 +1,20 @@ +// CECS 447 SPI Master Test +#include "mbed.h" + + // default is 8 bits, mode 1, + // Instantiante Functions and Classes + SPI device(p11, p12, p13); + DigitalOut cs(p14); + DigitalIn myButton(p23); + Serial pc(USBTX, USBRX); // tx, rx + + + int main(){ + pc.baud(9600); + pc.printf("Starting transmission.\n\r"); + cs = 0; + if (myButton){ + int response = device.write(0xFF); + cs = 1; + } + } \ No newline at end of file