Converting a piece of PIC code to Arduino

Do you actually understand what the PIC is doing?

As far as inputs and outputs are concerned, perhaps you should go back and review how to blink an LED and read a switch on the Arduino. The same principles apply to this project.