pinMode(motionSensorPin, INPUT_PULLUP); attachInterrupt(digitalPinToInterrupt(motionSensorPin), motionDetected, RISING);