Code from first working GS3-Arduino sensor system