cleanup
authorDan White <dan@whiteaudio.com>
Fri, 15 Jun 2012 22:17:34 +0000 (17:17 -0500)
committerDan White <dan@whiteaudio.com>
Fri, 15 Jun 2012 22:17:34 +0000 (17:17 -0500)
python-lib/mpsse-test.py

index c66acdc4034ee01dab7e9d910ce2ce0a9c1abdce..7f0b21f9de031a245d5e9acf69474eaa3259568a 100755 (executable)
@@ -16,7 +16,7 @@ do_shell = True
 
 
 
-def bytes2str(self, c):
+def bytes2str(c):
     r = c
     if not isinstance(c, str):
         if isinstance(c, (tuple, list)):
@@ -25,9 +25,11 @@ def bytes2str(self, c):
             raise TypeError, 'Cannot convert type %s to raw string.' % type(c)
     return r
 
+
 def mkcfg(n):
     return ''.join(map(chr, np.random.randint(0, 256, n)))
 
+
 def str2hex(x):
     return ''.join(map(lambda h: '%02x' % ord(h), x))
 
@@ -330,6 +332,23 @@ if 0:
         print str2hex(code[-4:]), str2hex(c2[-4:])
 
 
+if 0:
+    raw_input()
+    cm = 0.9
+    vos = 0.2
+    dac.vcmi(cm)
+    while True:
+        for i in range(1000):
+            a = 0.2*sin(2*pi*i/1000.0)
+            a = 0.2 * (i - 500.0)/1000.0
+            va = cm + a + vos
+            vb = cm - a + vos
+            print '%3i %6.3f %6.3f %6.3f' % (i, a, va, vb)
+            dac.vina(va)
+            dac.vinb(vb)
+            sleep(0.01)
+
+
 ##############################################################################
 # drop into an IPython shell
 #
@@ -337,3 +356,4 @@ if do_shell:
     IPython.embed()
 
 
+