Could you please provide some code examples on how to write to the device and change the settings, such as update rate.