C Code for the rover master PIC