-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added all animations from acab2 machine
- Loading branch information
Showing
24 changed files
with
686 additions
and
160 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
|
||
import acabsl | ||
import time | ||
t = 1 | ||
|
||
acabsl.update() | ||
|
||
def set_all_wall(r,g,b): | ||
acabsl.set_target("127.0.0.1",6002) | ||
for w in range(acabsl.NOOFWALLS): | ||
for x in range(acabsl.WALLSIZEX): | ||
for y in range(acabsl.WALLSIZEY): | ||
acabsl.send(x,y,r,g,b,1,w) | ||
acabsl.update() | ||
|
||
def set_wall_to_black(): | ||
set_all_wall(0,0,0) | ||
time.sleep(t) | ||
|
||
def main(): | ||
while 1: | ||
set_wall_to_black() | ||
|
||
if __name__ == '__main__': | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
|
||
import acabsl | ||
import time | ||
t = 1 | ||
|
||
acabsl.update() | ||
|
||
def set_all(r,g,b): | ||
acabsl.set_target("127.0.0.1",6002) | ||
for w in range(acabsl.NOOFWALLS): | ||
for x in range(acabsl.WALLSIZEX): | ||
for y in range(acabsl.WALLSIZEY): | ||
acabsl.send(x,y,r,g,b,1,w) | ||
acabsl.update() | ||
acabsl.set_target("127.0.0.1",8002) | ||
for w in range(acabsl.NOOFWALLS): | ||
for x in range(acabsl.WALLSIZEX): | ||
for y in range(acabsl.WALLSIZEY): | ||
acabsl.send(x,y,r,g,b,1,w) | ||
acabsl.update() | ||
|
||
def set_all_to_black(): | ||
set_all(0,0,0) | ||
|
||
def main(): | ||
while 1: | ||
set_all_to_black() | ||
time.sleep(t) | ||
|
||
if __name__ == '__main__': | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
|
||
import acabsl | ||
import time | ||
t = 1 | ||
|
||
acabsl.update() | ||
|
||
def set_all(r,g,b): | ||
for w in range(1): | ||
for x in range(2): | ||
for y in range(12): | ||
acabsl.send(x,y,r,g,b,1,1) | ||
acabsl.update() | ||
|
||
while 1: | ||
set_all(0,0,0) | ||
time.sleep(t) | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/usr/bin/python | ||
|
||
import acabsl | ||
import time | ||
t = 1 | ||
|
||
acabsl.update() | ||
|
||
def set_all(r,g,b): | ||
for w in range(acabsl.NOOFWALLS): | ||
for x in range(acabsl.WALLSIZEX): | ||
for y in range(acabsl.WALLSIZEY): | ||
acabsl.send(x,y,r,g,b,0,w) | ||
acabsl.update() | ||
|
||
while 1: | ||
set_all(0,255,0) | ||
time.sleep(t) | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ | |
|
||
NOOFWALLS=2 | ||
|
||
tick = 0.5 | ||
tick = 2 | ||
|
||
def set(r,g,b,time): | ||
for x in range(acabsl.WALLSIZEX): | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
from acabsl import send | ||
from acabsl import update | ||
import acabsl | ||
|
||
import colorsys | ||
import random | ||
import time | ||
|
||
tick = 0.8 | ||
|
||
def setdata(data, time): | ||
for x in range(0,acabsl.WALLSIZEX): | ||
for y in range(0,acabsl.WALLSIZEY): | ||
r,g,b = colorsys.hsv_to_rgb(data[x][y], 1., 1.) | ||
send(x,y,r*255,g*255,b*255,time); | ||
update() | ||
|
||
def shift(l,n): | ||
return l[n:] + l[:n] | ||
|
||
f = 0.66 | ||
b = 0.16 | ||
data = [ | ||
[f,f,b, b, b,b,b, b, b,f,b ,b ,f,b,b ,b ,b,b,b ,b ,b,b,b ,b,b,b], | ||
[f,b,f, b, f,b,f, b, b,f,b ,b ,f,f,b ,b ,b,f,b ,b ,f,f,b ,b,b,b], | ||
[f,f,b, b, f,b,f, b, f,f,f ,b ,f,b,f ,b ,f,b,f ,b ,f,b,f ,b,b,b], | ||
[f,b,b, b, f,b,f, b, b,f,b ,b ,f,b,f ,b ,f,b,f ,b ,f,b,f ,b,b,b], | ||
[f,b,b, b, b,f,b, b, b,f,b ,b ,f,b,f ,b ,b,f,b ,b ,f,b,f ,b,b,b], | ||
[b,b,b, b, f,b,b, b, b,b,b ,b ,b,b,b ,b ,b,b,b ,b ,b,b,b ,b,b,b] | ||
] | ||
data = zip(*data) | ||
update() | ||
while 1: | ||
data = shift(data,1) | ||
setdata(data, 0.1) | ||
time.sleep(tick) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
from acabsl import send | ||
from acabsl import update | ||
import acabsl | ||
|
||
import colorsys | ||
import random | ||
import time | ||
|
||
tick = 2.6 | ||
|
||
def setcol(col, r, g, b, time): | ||
for i in range(0,acabsl.WALLSIZEY): | ||
send(col,i,r,g,b,time); | ||
update() | ||
|
||
h = 0 | ||
col = 0 | ||
update() | ||
while 1: | ||
h += random.gauss(0.02,0.05) | ||
h = h % 1. | ||
|
||
col += 1 | ||
col = col % acabsl.WALLSIZEX | ||
|
||
r,g,b = colorsys.hsv_to_rgb(h, 1., 1.) | ||
setcol(col, r*255, g*255, b*255, tick*3) | ||
|
||
time.sleep(tick) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/usr/bin/python | ||
|
||
import acabsl | ||
import time | ||
import random | ||
|
||
t = 2.5 | ||
|
||
acabsl.update() | ||
|
||
def set_all(r,g,b): | ||
for w in range(acabsl.NOOFWALLS): | ||
for x in range(acabsl.WALLSIZEX): | ||
for y in range(acabsl.WALLSIZEY): | ||
acabsl.send(x,y,r,g,b,0,w) | ||
acabsl.update() | ||
|
||
|
||
def set_random(r,g,b): | ||
for w in [random.choice(range(acabsl.NOOFWALLS))]: | ||
for x in [random.choice(range(acabsl.WALLSIZEX))]: | ||
for y in [random.choice(range(acabsl.WALLSIZEY))]: | ||
acabsl.send(x,y,r,g,b,0,w) | ||
acabsl.update() | ||
|
||
|
||
while 1: | ||
set_all(0,0,0) | ||
#set_random(255,0,0) | ||
set_random(random.choice(range(0,255)),random.choice(range(0,255)),random.choice(range(0,255))) | ||
time.sleep(t) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
|
||
import acabsl | ||
import time | ||
t = .3 | ||
t = 1.8 | ||
|
||
acabsl.update() | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/usr/bin/python | ||
|
||
import acabsl | ||
import time | ||
t = 1 | ||
|
||
acabsl.update() | ||
|
||
def set_all(r,g,b): | ||
for w in range(acabsl.NOOFWALLS): | ||
for x in range(acabsl.WALLSIZEX): | ||
for y in range(acabsl.WALLSIZEY): | ||
acabsl.send(x,y,r,g,b,0,w) | ||
acabsl.update() | ||
|
||
while 1: | ||
set_all(255,0,0) | ||
time.sleep(t) | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ | |
import time | ||
import math | ||
|
||
tick = 0.15 | ||
tick = 1.65 | ||
|
||
def setcol(col, r, g, b, time): | ||
for i in range(0,6): | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ | |
import time | ||
import math | ||
|
||
tick = 0.4 | ||
tick = 1.9 | ||
|
||
def setcol(col, r, g, b, time): | ||
for i in range(0,6): | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
#!/usr/bin/python | ||
|
||
import acabsl | ||
import time | ||
import serialinterface | ||
import sys | ||
import random | ||
|
||
print sys.argv[1] | ||
|
||
serial = serialinterface.SerialInterface(sys.argv[1],115200,1) | ||
|
||
t = 1 | ||
|
||
acabsl.update() | ||
|
||
def set_all(r,g,b): | ||
for w in range(acabsl.NOOFWALLS): | ||
for x in range(acabsl.WALLSIZEX): | ||
for y in range(acabsl.WALLSIZEY): | ||
acabsl.send(x,y,r,g,b,0,w) | ||
|
||
def set_pattern(): | ||
set_all(0,0,0) | ||
r = random.random()*127+127 | ||
g = random.random()*127+127 | ||
b = random.random()*127+127 | ||
|
||
acabsl.send(5,0,r,g,b) | ||
acabsl.send(5,0,r,g,b) | ||
acabsl.send(7,0,r,g,b) | ||
acabsl.send(8,0,r,g,b) | ||
acabsl.send(9,0,r,g,b) | ||
acabsl.send(0xA,0,r,g,b) | ||
acabsl.send(0xD,0,r,g,b) | ||
|
||
|
||
acabsl.send(6,1,r,g,b) | ||
acabsl.send(8,1,r,g,b) | ||
acabsl.send(9,1,r,g,b) | ||
acabsl.send(0XC,1,r,g,b) | ||
|
||
acabsl.send(6,2,r,g,b) | ||
acabsl.send(8,2,r,g,b) | ||
acabsl.send(0xB,2,r,g,b) | ||
acabsl.send(0xC,2,r,g,b) | ||
|
||
|
||
acabsl.send(5,3,r,g,b) | ||
acabsl.send(5,3,r,g,b) | ||
acabsl.send(7,3,r,g,b) | ||
acabsl.send(0xA,3,r,g,b) | ||
acabsl.send(0xC,3,r,g,b) | ||
acabsl.send(0xD,3,r,g,b) | ||
acabsl.send(0xE,3,r,g,b) | ||
|
||
acabsl.send(0x8,4,r,g,b) | ||
acabsl.send(0x9,4,r,g,b) | ||
acabsl.send(0xB,4,r,g,b) | ||
|
||
t0 = 0 | ||
while 1: | ||
#channel, message = serial.readMessage() | ||
message = serial.readMessage() | ||
#print channel, message | ||
#if channel and message == 'bar': | ||
if message == 'bar': | ||
if time.time() - t0 > 1: | ||
set_pattern() | ||
acabsl.update() | ||
t0 = time.time() | ||
#time.sleep(1) | ||
|
||
|
||
|
Oops, something went wrong.