Converting a code from AVR to arduino

that actually makes sense, thanks mate :wink: