example code for spi dc motor firmware