Changeset 770 in ETALON


Ignore:
Timestamp:
May 25, 2018, 11:31:16 AM (6 years ago)
Author:
moutardier
Message:

modification de motor controler pour afficher des graphiques (ne fonctionne pas)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • BPM/motor_control.py

    r768 r770  
    44from initialise_motors import *
    55from scope_function import *
     6import matplotlib.pyplot as plt
    67
    78# moteur 1 -> horizontal
    89# moteur 2 -> verticale
    910
    10 motor_enable(1)
     11#motor_enable(1)
    1112
    1213#controller_hello()
     
    2122
    2223#position_test_horizontal()
     24
     25
     26# creation graphique
     27
     28A = loadtxt('donnees.dat')
     29X = []
     30Y1 = []
     31Y2 = []
     32Y3 = []
     33Y4 = []
     34
     35for i in range(A):
     36    if (i%5) == 0:
     37        X.append(A[i])
     38    elif (i%5) == 1:
     39        Y1.append(A[i])
     40    elif (i%5) == 2:
     41        Y2.append(A[i])
     42    elif (i%5) == 3:
     43        Y3.append(A[i])
     44    else:
     45        Y4.append(A[i])
     46
     47plt.plot(X,Y1)
     48plt.show()
     49
     50
     51"""
    2352turn_on()
    2453fichier = open("24-05-2018_aquisition_from_0_to_400000_step_of_1000.txt", "w")
     
    2655fichier.close()
    2756turn_off()
     57"""
    2858
    2959
Note: See TracChangeset for help on using the changeset viewer.