forked from j3d1/fiatlux
Fixed stuff
This commit is contained in:
parent
b03ac0fef3
commit
4618dc95a9
5 changed files with 68 additions and 23 deletions
27
peripherals/cc48x6/test.py
Normal file
27
peripherals/cc48x6/test.py
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
#!/usr/bin/env python3
|
||||
import serial
|
||||
import time
|
||||
ser = serial.Serial("/dev/ttyUSB0", 115200)
|
||||
|
||||
def setCh(ch, ana, pwm):
|
||||
ser.write(bytearray([ch*4+1, ana >> 8, ch*4+2, ana & 0xff, ch*4+4, pwm, 0,0]))
|
||||
|
||||
def setG(val):
|
||||
ser.write(bytearray([128,val,0]))
|
||||
|
||||
setCh(0,0,0)
|
||||
setCh(1,0,0)
|
||||
setCh(2,0,0)
|
||||
setCh(3,0,0)
|
||||
setCh(4,0,0)
|
||||
setCh(5,0,0)
|
||||
|
||||
if False: #for i in range(0, 4095, 5):
|
||||
print(i)
|
||||
setCh(0,i,255)
|
||||
time.sleep(0.1)
|
||||
|
||||
for i in range(255):
|
||||
print(i)
|
||||
setG(i)
|
||||
time.sleep(0.5)
|
||||
Loading…
Add table
Add a link
Reference in a new issue