from tools import *
import time

init()

# Allumage de la lampe sur la sortie MOS
while (True):
    consigne = entree('{"cible":"potentiometre"}')
    consigne = int(consigne / 4)
    sortie("{ 'cible':'MOS','PWM':"+ str(100) +"}")
    print("{ 'cible':'MOS','PWM':"+ str(consigne) +"}")
    print(str(1000*entree('{"cible":"Ibat"}'))+"mA")
    time.sleep(0.2)

