from struct import*
import ctypes
import array
import numpy as np
import matplotlib.pyplot as plt
import time

from ADUCv2p0 import*




chip1 = ADUCv2p0(0x50,True)

chip1.set_channel(3) #ADC

chip1.set_remote_trigg(1)

chip1.set_pga_state(0x78)

chip1.set_Vout(0,790)

Nwf = 120*10

dat = np.zeros(Nwf)


for k in range(0,Nwf):
    data = chip1.read_data()
    dat[k] = np.mean(data)
    time.sleep(30)
    print(k,dat[k])
    np.save("drift3",dat)
    


plt.plot(dat)
plt.show()


