hi everybody, finally i could communicate the arduino with the blender game engine.
i get the information from here:
http://en.myinventions.pl/index.php?page=ArduinoToBlender
i'm controlling a cube with 2 potentiometers (2 externals signs) one is for the direccion and the other one is for the speed, as you can see this ambient, cube(blue) , floor (green), ramp(gray)

Arduino code
void setup()
{
Serial.begin(9600);
}
void loop()
{
Serial.print(analogRead(0)/4, BYTE); //direction
Serial.print(analogRead(1)/4, BYTE); // speed
delay(40);
}
this is the python script which receives the 2 inputs from the serial port and write them on the text file.
import serial
serialport = serial.Serial('COM3', 9600)
while 1:
dane=open('dane.txt', 'r+b')
x = serialport.read(size=1)
print x
dane.write(x)
y = serialport.read(size=1)
print y
dane.write(y)
dane.close()
serialport.close()
this is the python script of the blender game engine which controls the direction and the speed of the cube.
import GameLogic
dane=open('dane.txt', 'rb')
x=dane.read(1)
y=dane.read(1)
dane.close()
contr = GameLogic.getCurrentController()
location=contr.actuators["loc"]
z = 0.001*(ord(x)-128)
location.dRot=[0,0,z] // direction
w = 0.001*(ord(y))
location.dLoc=[w,0,0] // speed
contr.activate(location)
i need to send a character to the serial port when the cube is climbing the ramp
i already have the code that identifies when the cube is going up with a variable, the variable is "a" and when the cube is going up a==1 and a==0 when not.