Debian Codegraph @

eyes17/code/clamping.py

raw
1 #import eyes17.eyes # uncomment these two lines while running stand-alone
2 #p = eyes17.eyes.open()
3
4 from pylab import *
5
6 p.set_sine(200)
7 p.set_pv1(1.7) # will clamp at 2.0 + diode drop
8
9 maxV = 8
10
11 p.select_range('A1', maxV)
12 p.select_range('A2', maxV)
13
14 t,v, tt,vv = p.capture2(500, 20) # captures A1 and A2
15
16 xlabel('Time(mS)')
17 ylabel('Voltage(V)')
18 plot([0,10], [0,0], 'black')
19 ylim([-maxV, maxV])
20
21 plot(t,v,linewidth = 2, color = 'blue', label='Input')
22 plot(tt, vv, linewidth = 2, color = 'red', label='Clamped')
23
24 legend(framealpha=0.5)
25
26 show()