Le programme a été écrit grace au logiciel CUBLOC en BASIC ( du moins je crois. )
Voilà, ça serait super sympa à vous si vous pouviez, encore une fois, me filer un coup de main

Dans l'attente d'une réponse, je vous laisse ci après le programme en question :
Const Device = CB220 Dim pas As Single Const minY As Single=2000 Const maxY As Single=4000 'Constantes des positions extremes et du pas Const minX As Single=3700 '-30degres Const maxX As Single=5000 '+30degres Dim mes_x As Integer Dim mes_y As Integer Dim mes_z As Integer Dim acc_x As Single Dim acc_y As Single Dim acc_z As Single Dim dx As Integer Dim dy As Integer Dim dz As Integer Dim angle_x As Single Dim angle_y As Single Dim angle_z As Single Low 5 'Configure les port P5 et P6 en sortie Low 6 Dim angle1 As Single Dim angle2 As Single Dim commande As Single Dim Npas As Single Do mes_x=Adin(0) acc_x=(mes_x-337.0)/167.0 mes_y=Adin(1) acc_y=(mes_y-345.0)/160.0 mes_z=Adin(2) acc_z=(mes_z-337.0)/167.0 angle1=Atan acc_x/(Sqr(acc_y*acc_y+acc_z*acc_z)) angle1=angle1/3.14257*180 angle2=Atan acc_y/(Sqr(acc_x*acc_x+acc_z*acc_z)) angle2=angle2/3.14257*180 Debug "angle1 = ", Float angle1,Cr Debug "angle2 = ", Float angle2,Cr If (angle1>2) Or (angle1<-2) Then pas=-20.0 commande=angle1*pas+4350 dx=commande Pwm 0, dx, 32768 Else dx=4350 Pwm 0, dx, 32768 Endif If (angle2>2) Or (angle2<-2) Then pas=20.0 commande=angle2*pas+3000 dy=commande Pwm 1, dy, 32768 Else dy=3000 Pwm 1, dy, 32768 Endif Debug Cr Delay 200 'Debug Float angle1,Cr 'Pwm 0,4900,32768 'Servo 2 en position -90° 'Delay 1000 'Pwm 0, 3700,32768 'Servo 2 en position -90° 'Delay 1000 'Pwm 1, 2100,32768 'Servo 2 en position -90° 'Delay 2000 'Pwm 1, 3700,32768 'Servo 2 en position -90° 'Delay 2000 Loop