PIC and Arduino code updated