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.
Fork of SPI_HelloWorld_Mbed by
main.cpp
- Committer:
- korotkiy_eugene
- Date:
- 2018-09-20
- Revision:
- 2:8b87ec0dce1b
- Parent:
- 1:cfd8aef8d053
File content as of revision 2:8b87ec0dce1b:
#include "mbed.h"
SPI spi(D11, D12, D13); // mosi, miso, sclk
DigitalOut cs(D10);
int main()
{
cs = 1;
uint8_t val = 0;
// Setup the spi for 8 bit data, low steady state clock,
// first edge capture, with a 1MHz clock rate
spi.format(8,0);
spi.frequency(1000000);
while (1) {
wait(0.5);
cs = 0;
spi.write(val++);
cs = 1;
}
}
