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.
Homepage
arduino code
#include <SPI.h>
void setup (void)
{
Serial.begin(9600);
digitalWrite(SS, HIGH); // ensure SS stays high for now
SPI.begin ();
SPI.setClockDivider(SPI_CLOCK_DIV32);
}
void loop (void)
{
int sensorDegeri = analogRead(A0);
Serial.println(sensorDegeri);
digitalWrite(SS, LOW);
SPI.transfer (sensorDegeri);
digitalWrite(SS, HIGH);
delay (1000); // 1 second delay between the next 255 bytes
}
lpc code;
#include "mbed.h"
Serial pc(USBTX, USBRX);
SPISlave spi(p11, p12, p13, p14); //mosi, miso, sclk,ss
int main() {
pc.baud(115200);
int x;
while(1) {
if(spi.receive()){
x = spi.read();
pc.printf("\r\n%d \n", x);
}
}
}