Debian Codegraph @

eyes17/code/diodeIV.py

raw
1 from pylab import *
2
3
4 voltage = []
5 current = []
6
7 v = 0.0
8 while v <= 5.0:
9 va = set_pv1(v)
10 vd = get_voltage('A1')
11 i = (va-vd)/1.0 # current in milli Amps
12 voltage.append(vd)
13 current.append(i)
14 v = v + 0.050 # 50 mV step
15
16 xlabel('Voltage')
17 ylabel('Current')
18 plot(voltage, current, linewidth = 2)
19 show()