So what you can do is you can connect the Arduino to Mathematica using the built-in Arduino device driver.
Depending on which version of Mathematica 10 you are using you will need to have the appropriate version of the Arduino software installed. You can check the in-product documentation page for Mathematica by searching for Arduino and noting the supported Arduino software version listed under the Device Properties section. The web link above is for Mathematica 10.3.
Once you have the appropriate version of the Arduino software installed, you can open a connection to the device with DeviceOpen, and then upload the custom Mathematica sketch with DeviceConfigure[ "Arduino" , "Upload" ]
Then you can turn on/off any pin with DeviceWrite["Arduino", 13 -> 1]
(replacing 13 with whatever pin you need and 1 with 0 if you need to turn if off). Note that the max frequency using DeviceWrite is around 140 Hz. If you need faster frequency, than you can use a custom function as documented under the DeviceConfigure section of the Arduino device driver documentation page.
Ian