Abstracted out the update function so that I can call it from other files.
Respond to sensor data from rails server.