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.
Diff: main.cpp
- Revision:
- 1:58f0712d9aa2
- Parent:
- 0:b7415ae44dac
- Child:
- 2:c520d7c7739d
diff -r b7415ae44dac -r 58f0712d9aa2 main.cpp --- a/main.cpp Wed May 24 10:17:56 2017 +0000 +++ b/main.cpp Wed May 31 07:39:37 2017 +0000 @@ -6,22 +6,13 @@ int main() { uart.printf("START!"); - device.format(8,1); - - device.reply(0xAA); // Prime SPI with first reply + device.format(8,1); + while(1) { if(device.receive()) { int v = device.read(); // Read byte from master - v = (v + 1) % 0x100; // Add one to it, modulo 256 - device.reply(v); // Make this the next reply - - v = device.read(); // Read byte from master - v = (v + 1) % 0x100; // Add one to it, modulo 256 - device.reply(v); // Make this the next reply - - v = device.read(); // Read byte from master - v = (v + 1) % 0x100; // Add one to it, modulo 256 - device.reply(v); // Make this the next reply + uart.printf("v = %s ", v); + } } } \ No newline at end of file