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 #include <SPISlave.h> 00003 00004 SPISlave device(D11, D12, D13, D8); 00005 int main() { 00006 device.reply(0x00); // Prime SPI with first reply 00007 while(1) { 00008 if(device.receive()) { 00009 int v = device.read(); // Read byte from master 00010 v = (v + 1) % 0x100; // Add one to it, modulo 256 00011 device.reply(v); // Make this the next reply 00012 } 00013 } 00014 }
Generated on Sat Jul 30 2022 09:37:56 by
1.7.2