Machine learning for microcontrollers and sensors