Shifting code from PICAXE to Arduino

C++ got it, still confusing