Code to controll RPi