Blender game controller using arduino not working properly
i don't have arduino but this should work, the problem its that you have an always sensor true level triggering = false (see the img), this means that your script will runs once.



Make it TRUE and now your script will run every frame.



And now your script should be:

import serial
import bge
from time import sleep

ser = serial.Serial('COM3', 9600)

movement = 0.1

def left():
    print("Function Started")
    cont = bge.logic.getCurrentController()
    player = cont.owner
#    count = 1
#    while count &lt; 50:
#        print("Count " + str(count))
#        count += 1
    if (ser.inWaiting() &gt; 0):
        var = ser.readline()
        print(var)
        var = str(var)
        var = var[2:-5]
        var = int(var)
        print('Int var : ' + str(var))
        print()
        movements = [var * movement * -1, 0, 0]
        local = False
        player.applyMovement(movements, local)
#        sleep(0.1)
#    ser.close()
    print("Serial port Closed.")


Since i dont have arduino i tested with this script.

#import serial
import bge
#from time import sleep

#ser = serial.Serial('COM3', 9600)

movement = 0.001

def left():
    print("Function Started")
    cont = bge.logic.getCurrentController()
    player = cont.owner
#    count = 1
#    while count &lt; 50:
#        print("Count " + str(count))
#        count += 1
    if True:
        var = '0.005564256'
        print(var)
        var = str(var)
        var = var[2:-5]
        var = int(var)
        print('Int var : ' + str(var))
        print()
        movements = [var * movement * -1, 0, 0]
        local = False
        player.applyMovement(movements, local)
#        sleep(0.1)
#    ser.close()
    print("Serial port Closed.")

#left()