示例#1
0
def set_image_RGB(g, imgs, x=None, y=None, m=0, addr=None):
    if x == None:
        x = 4 - imgs[0].width() // 2
    if y == None:
        y = 4 - imgs[0].height() // 2
    cmd = b'seIC%c' % g + _ % (x, y, m)
    for i in imgs:
        cmd += b'%s\x00' % (repr(i)[7:-3])
    C(S(addr, 15), cmd, 1)
示例#2
0
def set_pixel_range(g,pos,cs,addr=None):
	i,X=0,len(cs)
	while i<X:
		css=cs[i:i+8]
		cmd=b'setL'+_%(g,pos,len(css))
		for c in css:
			cmd+=_%c
		C(S(addr,15),cmd,1)
		i+=8;pos+=8
示例#3
0
def set_xy(g,x,y,c,addr=None):
	C(S(addr,15),b'setX%c%c%c'%(g,x,y)+_%c,1)
示例#4
0
def set_pixel(addr,g,pos,c):
	C(addr,b'setP%c%c'%(g,pos)+_%c,1)
示例#5
0
def fill(addr,g,c):
	C(addr,b'fill%c'%g+_%c,1)
示例#6
0
def setup(grps,addr):
	cmd=b'init%c'%len(grps)
	for t in grps:
		cmd+=b'%c'%t
	C(addr,cmd,1)
示例#7
0
def set_xy(addr,g,x,y,c):
	C(addr,b'setX%c%c%c'%(g,x,y)+_%c,1)
示例#8
0
def shift(addr,g,x,y=0):
	C(addr,b'shft'+_%(g,P(x),P(y)),1)
示例#9
0
def set_pixel(g,pos,c,addr=None):
	C(S(addr,15),b'setP%c%c'%(g,pos)+_%c,1)
示例#10
0
def set_image(g, img, x=None, y=None, m=0, addr=None):
    if x == None:
        x = 4 - img.width() // 2
    if y == None:
        y = 4 - img.height() // 2
    C(S(addr, 15), b'setI%c%c%c%c%s\x00' % (g, x, y, m, repr(img)[7:-3]), 1)
示例#11
0
def get_t(addr):
    return C(addr, b'getT', 2)
示例#12
0
def get_p(addr):
    return C(addr, b'getP', 2)
示例#13
0
def get_a(addr):
    return C(addr, b'getA', 2)
示例#14
0
def set_rainbow(addr,g,t,x,n):
	C(addr,b'rnbl%c%c%c%c '%(g,t,x,n),1)
示例#15
0
def setup(grps,addr=None):
	cmd=b'init%c'%len(grps)
	for t in grps:
		cmd+=b'%c'%t
	C(S(addr,15),cmd,1)
示例#16
0
def fill(g,c,addr=None):
	C(S(addr,15),b'fill%c'%g+_%c,1)
示例#17
0
def shift(g, x, y=0, addr=None):
    C(S(addr, 15), b'shft' + _ % (g, P(x), P(y)), 1)
示例#18
0
def set_rainbow(g, t, x, n, addr=None):
    C(S(addr, 15), b'rnbl%c%c%c%c ' % (g, t, x, n), 1)
示例#19
0
def motor(val, addr):
    return C(addr, b'get%s%c' % ('bf'[val > 0], abs(val) // 4))