/*
Wokwi Custom SPI Chip example
The chip implements a simple ROT13 letter substitution cipher:
https://en.wikipedia.org/wiki/ROT13
*/
//include the SPI library
#include <SPI.h>
//defining the SS/CS PIN. in this case CS is Pin 10
#define CS 10
void setup() {
//sending the string to the SPI "device"
char buffer[] = "Uryyb, FCV! ";
//starts communication
Serial.begin(115200);
//Sets the CS pin as an output.
pinMode(CS, OUTPUT);
// SPI Transaction: sends the contents of buffer, and overwrites it with the received data.
digitalWrite(CS, LOW);
SPI.begin();
SPI.transfer(buffer, strlen(buffer));
SPI.end();
digitalWrite(CS, HIGH);
Serial.println("Data received from SPI device:");
Serial.println(buffer);
}
void loop() {
}