@@ -0,0 +1,781 @@
+#!/usr/bin/python%0Aimport serial, time%0Aser = serial.Serial('/dev/ttyACM0',  115200, timeout = 0.1)%0A%0A#if you only want to send data to arduino (i.e. a signal to move a servo)%0Adef send( theinput ):%0A  ser.write( theinput )%0A  while True:%0A    try:%0A      time.sleep(0.01)%0A      break%0A    except:%0A      pass%0A  time.sleep(0.1)%0A%0A#if you would like to tell the arduino that you would like to receive data from the arduino%0Adef send_and_receive( theinput ):%0A  ser.write( theinput )%0A  while True:%0A    try:%0A      time.sleep(0.01)%0A      state = ser.readline()%0A      print state%0A      return state%0A    except:%0A      pass%0A  time.sleep(0.1)%0A%0Af = open('dataFile.txt','a')%0A%0Awhile 1 :%0A    arduino_sensor = send_and_receive('1')%0A    f.write(arduino_sensor)%0A    f.close()%0A    f = open('dataFile.txt','a')%0A

Create robust.py