started porting arduino code to stm32