aboutsummaryrefslogtreecommitdiff
path: root/software/animation.ino
diff options
context:
space:
mode:
Diffstat (limited to 'software/animation.ino')
-rw-r--r--software/animation.ino8
1 files changed, 6 insertions, 2 deletions
diff --git a/software/animation.ino b/software/animation.ino
index e59bfa1..edd0c82 100644
--- a/software/animation.ino
+++ b/software/animation.ino
@@ -4,6 +4,10 @@ unsigned long clamp_time(unsigned long unclamped_time) {
return unclamped_time / frame_time_millis * frame_time_millis;
}
+unsigned long get_frame(unsigned long relative_time) {
+ return relative_time / frame_time_millis;
+}
+
unsigned int zigzag(unsigned int size, int index) {
unsigned int zigzag_size = 2 * size - 2;
unsigned int mod = index % zigzag_size;
@@ -19,11 +23,11 @@ void fill_plane(unsigned int direction, unsigned int offset) {
unsigned int axis2_weight = pow((direction - 1) % 3, 4);
unsigned int axis3_weight = pow((direction ) % 3, 4);
- led_state[
+ led_state[led_map[
axis1_offset * axis1_weight +
axis2_offset * axis2_weight +
offset * axis3_weight
- ] = 1;
+ ]] = 1;
}
}