added spi output code