Convert C into Arduino Uno 3

Define "correct".

The code, as far as I can see, will compile, and if you just move one pin, will do...something.