Reverted last changes on ArduinoDirectMode and just copied Diego's code for the shift register from its firmata