code from patrick for his arduino step taking