Skip to content

Commit

Permalink
done for now
Browse files Browse the repository at this point in the history
  • Loading branch information
joeynelson committed Nov 3, 2024
1 parent 1156faa commit 92897c0
Showing 1 changed file with 32 additions and 6 deletions.
38 changes: 32 additions & 6 deletions software/software/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@



max_mode = 12
max_mode = 13
mode = max_mode - 1
counter = 0.0
delay_time = 100
Expand Down Expand Up @@ -53,7 +53,10 @@

countdown = countdown - timestep
if countdown < 0:
mode = random.randint(0,max_mode-1)
next_mode = mode
while next_mode == mode:
next_mode = random.randint(0,max_mode-1)
mode = next_mode
c2 = 0
countdown = timeout
print("mode:", mode)
Expand Down Expand Up @@ -136,6 +139,7 @@
for j in range(7):
if random.randint(0,1000) < 10:
display[i] = display[i] ^ 1 << j

elif mode == 4:
for i in range(8):
display[i] = 0
Expand Down Expand Up @@ -173,9 +177,12 @@
t1 = c2 / 30
t2 = t1 - math.pi / 8
t3 = t2 - math.pi / 8
p1 = int((math.sin(t1) + 1) * 4)
p2 = int((math.sin(t2) + 1) * 4)
p3 = int((math.sin(t3) + 1) * 4)
count = int(t1 / (math.pi * 2))

p1 = (count + int((math.sin(t1) + 1) * 4)) % 8
p2 = (count + int((math.sin(t2) + 1) * 4)) % 8
p3 = (count + int((math.sin(t3) + 1) * 4)) % 8

for i in range(8):
if i == p1:
display[i] = 0x7f
Expand Down Expand Up @@ -231,7 +238,26 @@
if (phase + j * 8 + i) % stepx == 0:
display[i] = 1 << j


elif mode == 12:
for i in range(8):
display[i] = 0
c2 = c2 + 1
phase = (c2 >> 3) % 24
phase2 = (-c2 >> 5) % 8
for loc in range(4):

for i in range(8):
intensity_vals[i] = 9
if int(phase / 3) == i:
display[i] = display[i] | 1 << (6 - (phase % 3))
phase = (phase + 1) % 24

for i in range(8):
if phase2 == i:
display[i] = display[i] | 1
if (phase2 + 1) % 8 == i:
display[i] = display[i] | 2



for i in range(4):
Expand Down

0 comments on commit 92897c0

Please sign in to comment.