// Master #include #define RX 5 // MISO #define TX 4 // SCK #define button_pin 8 #define led_pin 7 SoftwareSerial Serial(RX, TX); void setup() { // config button_pin als INPUT for a connected button (normally open; connects to GND) pinMode( button_pin, INPUT_PULLUP); // config led_pin as OUTPUT for a connected LED pinMode( led_pin, OUTPUT); // pinMode( 6, INPUT_PULLUP); // pinMode( 4, INPUT_PULLUP); Serial.begin(9600); } void loop() { // check, if the button was pressed if(digitalRead(button_pin) == 0){ Serial.println("STARTING"); Serial.write('O'); if (Serial.available()) { char SlaveCommand = Serial.read(); if(SlaveCommand == 'R') { digitalWrite(led_pin, HIGH); } } } }