     //if ((io_direction& PIN_MASK(_pin)) != 0)
     {
         digitalWrite ( _pin, _value == SQ_TRUE ? HIGH : LOW );
-        io_last_written = (io_last_written & (~(PIN_MASK(_pin)))) | (_value >> _pin);
+        io_last_written[_pin] = _value;
         //sq_digital_pin_updated ( _pin, _value );
     }
     /*


/* Skip the first two pins, they are used by the USB port for communication. */
#define PIN_OFFSET 2
#define NUMBER_OF_PINS 14
#define IO_MASK 0x3FFC

static char buff[10];


 * name arduino_io
 * property /sequanto_automation_version sequanto_automation_version
 *
 * property /digital/(2..54)/direction digital_direction_get digital_direction_set
 * property /digital/(2..54)/pin digital_pin_get digital_pin_set
 * #property /digital/(2..54)/counter digital_counter_get digital_counter_set
 * #property /digital/(2..54)/counter_enabled digital_counter_enabled_get digital_counter_enabled_set
 * #property /digital/(2..54)/count_on_high2low digital_counter_high2low_get digital_counter_high2low_set
 * #property /digital/(2..54)/count_on_low2high digital_counter_low2high_get digital_counter_low2high_set
 *
 * # property /digital/(0..14)/mode digital_mode_get digital_mode_set
 * # property /digital/(0..14)/counter digital_counter_get digital_counter_set
