Use the Serial Monitor in the Arduino IDE to send commands to the Arduino, and the Arduino serial port to receive them. Then you can write a sketch to do whatever you want on the Arduino in response to the commands received.

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.