diff options
| -rwxr-xr-x | calibrate.py | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/calibrate.py b/calibrate.py index f793bf6..55db7f6 100755 --- a/calibrate.py +++ b/calibrate.py @@ -1,9 +1,12 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- """ -Example for using Helios DAC libraries in python (using C library with ctypes) +WriteFrame(unsigned int dacNum, int pps, std::uint8_t flags, HeliosPoint* points, int numOfPoints); -NB: If you haven't set up udev rules you need to use sudo to run the program for it to detect the DAC. +in 1024 points: +scale up x from 0 to 100% +scale down y from 0 to 100% +scale R, G and B up from 0 to 255 4 times out of sync """ import ctypes @@ -22,29 +25,25 @@ class HeliosPoint(ctypes.Structure): HeliosLib = ctypes.cdll.LoadLibrary("./libHeliosDacAPI.dylib") numDevices = HeliosLib.OpenDevices() -#WriteFrame(unsigned int dacNum, int pps, std::uint8_t flags, HeliosPoint* points, int numOfPoints); -#in 1024 points: -#scale up x from 0 to 100% -#scale down y from 0 to 100% -#scale R, G and B up from 0 to 255 4 times out of sync frames=[0 for x in range(1024)] r=0 g=85 b=170 +intensity=256 def inc8(m): return (m+1)%256 for i in range(1024): - frames[i]=HeliosPoint(i*16,16383-(i*16),r,g,b,100) + frames[i]=HeliosPoint(int(i*16),int(16383-(i*16)),int(r),int(g),int(b),int(intensity)) r=inc8(r) g=inc8(g) b=inc8(b) try: while True: - HeliosLib.WriteFrame(0, 4096, 0, ctypes.pointer(frames[0]), 1024) + HeliosLib.WriteFrame(0, 20000, 0, ctypes.pointer(frames[0]), 1024) except KeyboardInterrupt: pass |
