import piplates.DAQC2plate as DAQC2
import numpy as np
import time

voltages = np.arange(2, 4, 0.1)

for v in voltages:
    DAQC2.setDAC(0, 0, v)
    time.sleep(0.25)
    DAQC2.setDAC(0, 0, 0)
    time.sleep(0.25)
    print("Vout = ", v)
import piplates.DAQC2plate as DAQC2
import time

DAQC2.setDAC(0, 0, 2.5)
time.sleep(0.25)
AIN = DAQC2.getADC(0, 0)
time.sleep(0.25)
DAQC2.setDAC(0, 0, 0)

print("AIN =", AIN, "volts")
Beispiel #3
0
 def set_value(self, value):
     DQ.setDAC(self.piid, self.tid, value)
Beispiel #4
0
import get_data
import write_data

try:
    import piplates.DAQC2plate as DAQC
except ImportError:
    print("Failed to import piplates-DAQCplate from python system path")
    raise ImportError(
        "Failed to import library from parent folder")

####### zet de LED uit
DAQC.setLED(0, 'off')

####### stuur de analoge output aan
DAQC.setDAC(0, 1, 2.64) # DAQ 0, adres analog-output 1, voltage 2.64 V

###### stuur 0, 1, 2, 3 volt naar analog-output 1
for i in range(10):
    volt = i % 4 # i modulo 4
    DAQC.setDAC(0, 1, volt)
    time.sleep(0.1)


####### Lees data van Analoge Input

val = DAQC.getADC(0, 1) # DAQC 0, adres Analog-Input 1
print(val)
val8 = DAQC.getADCall(0) # lees alle 8 Analog-Inputs
print(val8)
Beispiel #5
0
    index = -1
    for i in range(photocurrent.size):
        if (photocurrent[i] >= 0):
            index = i
            break

    V_s = retarding_voltage[index][0]
    print('V_s = {:.4f} V'.format(V_s))
    return V_s


### MAIN ###
voltages = np.arange(0, 0.7, 0.001)
np.random.shuffle(voltages)
led_data = np.zeros((voltages.size, 3))
dark_current = 1.3e-03

for i in range(voltages.size):
    Vr = voltages[i]
    led_data[i, 0] = Vr
    DAQC2.setDAC(0, 0, Vr)
    Vp = DAQC2.getADC(0, 0) - DAQC2.getADC(0, 1)
    led_data[i, 1] = Vp
    led_data[i, 2] = dark_current

wavelength = 654.9
led_df = create_LED_df(led_data)
filename = "data/laser_{λ}nm.csv".format(λ=wavelength)
led_df.to_csv(filename, encoding='utf-8', index=False)
plot_LED_data(led_df, np.array(wavelength))