
from Arduino import Arduino
import time

ard = Arduino('COM3',[4,4])
time.sleep(1)
RAPPORT = 0
TENSION = 1
KP = 2
KI = 3
Kp = -0.05
Ki = -0.1
ard.write_float(KP,Kp)
ard.write_float(KI,Ki)
while True:
    r = input('?')
    if r=='n': break
    elif r=="v":
        Vs = ard.read_float(TENSION)
        print("Vs = %f"%Vs)
    else:
        tension = float(r)
        ard.write_float(TENSION,tension)

ard.close()
       
                                 