Code for an arduino sensor.