// Simple SPI MASTER example // Counts number of presses on a button connected to D2 (PD2), // and sends the count and the count+100 over SPI. // Uses a mix of Arduino and plain AVR code, // but does not use the Arduino SPI library. long int count=1; void setup() { Serial.begin(115200); Serial.println("Hello from MASTER") // Declare pushbutton as input using the Arduino-way ;) pinMode(2, INPUT); // Set SCK, MOSI and SS as OUTPUTS using the AVR-way ;) DDRB |= (1<