To compile it in the Arduino IDE either save it as a text file and rename it to a .cpp file, or copy and paste the text into a new empty project file. You can download the latest Arduino IDE from arduino.cc.Select the correct Board option for your platform on the Tools menu, ...