/*
*/
#include <SPI.h>
#define CS 10
void setup()
{
Serial.begin(115200);
pinMode(CS, OUTPUT);
digitalWrite(CS, HIGH);
}
uint8_t loopcount = 0;
void loop()
{
char buffer[] = "123456";
loopcount++;
delay(1000);
Serial.print("Loop ");
Serial.println((int)loopcount);
// 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();
Serial.println(buffer);
digitalWrite(CS, HIGH);
}