Debian Codegraph @

eyes17/examples/r2ftime.py

raw
1 '''
2 r2ftime(in1, in2) returns the microseconds elapsed from a rising edge on input1 to a falling edge of input2,
3 they could be the same
4 '''
5
6 from __future__ import print_function
7 import eyes17.eyes
8 p = eyes17.eyes.open()
9
10 p.set_sqr1(1000,30) # set 1kHz squarewave, 30% duty cycle
11
12 print (p.r2ftime('IN2', 'IN2'))
13
14 p.set_sqr1(1000,60) # set 1kHz squarewave, 60% duty cycle
15
16 print (p.r2ftime('IN2', 'IN2'))