diff --git a/lib/libesp32/berry_animation/anim_tutorials/chap_5_10_beacon.anim b/lib/libesp32/berry_animation/anim_tutorials/chap_5_10_beacon.anim new file mode 100644 index 000000000..8076f6a09 --- /dev/null +++ b/lib/libesp32/berry_animation/anim_tutorials/chap_5_10_beacon.anim @@ -0,0 +1,6 @@ +# @desc Static beacon + +# Simple beacon starting at pixel 6 with size of 7 pixels, no border +animation back = beacon_animation(back_color = blue, color = red, + pos = 5, beacon_size = 7) +run back \ No newline at end of file diff --git a/lib/libesp32/berry_animation/anim_tutorials/chap_5_15_beacon_slew.anim b/lib/libesp32/berry_animation/anim_tutorials/chap_5_15_beacon_slew.anim new file mode 100644 index 000000000..0f093cd24 --- /dev/null +++ b/lib/libesp32/berry_animation/anim_tutorials/chap_5_15_beacon_slew.anim @@ -0,0 +1,6 @@ +# @desc Static beacon with slew + +# Simple beacon starting at pixel 6 with size of 7 pixels, no border +animation back = beacon_animation(back_color = blue, color = red, + pos = 5, beacon_size = 7, slew_size = 3) +run back \ No newline at end of file diff --git a/lib/libesp32/berry_animation/anim_tutorials/chap_5_20_beacon_slew_osc.anim b/lib/libesp32/berry_animation/anim_tutorials/chap_5_20_beacon_slew_osc.anim new file mode 100644 index 000000000..42d23c930 --- /dev/null +++ b/lib/libesp32/berry_animation/anim_tutorials/chap_5_20_beacon_slew_osc.anim @@ -0,0 +1,9 @@ +# @desc Static beacon with oscillating slew + +# Define an oscillating value from 0 to 4 and back to 0 in 2 seconds +set slew = cosine_osc(min_value = 0, max_value = 4, duration = 2s) + +# Simple beacon starting at pixel 6 with size of 7 pixels, no border +animation back = beacon_animation(back_color = blue, color = red, + pos = 5, beacon_size = 7, slew_size = slew) +run back \ No newline at end of file diff --git a/lib/libesp32/berry_animation/anim_tutorials/chap_5_30_cylon.anim b/lib/libesp32/berry_animation/anim_tutorials/chap_5_30_cylon.anim new file mode 100644 index 000000000..bf074707f --- /dev/null +++ b/lib/libesp32/berry_animation/anim_tutorials/chap_5_30_cylon.anim @@ -0,0 +1,13 @@ +# @desc Moving red beacon - Cylon style + +# Because strip_length is dynamic, we need to map it to a variable and can't use the function directly in formulas +set strip_len = strip_length() + +# In this example, the 'cosine_osc' is created within the call +animation back = beacon_animation( + color = red + pos = cosine_osc(min_value = -1, max_value = strip_len - 2, duration = 5s) + beacon_size = 3 # small 3 pixels eye + slew_size = 2 # with 2 pixel shading around +) +run back \ No newline at end of file diff --git a/lib/libesp32/berry_animation/anim_tutorials/chap_5_40_cylon_rainbow.anim b/lib/libesp32/berry_animation/anim_tutorials/chap_5_40_cylon_rainbow.anim new file mode 100644 index 000000000..5db22a77a --- /dev/null +++ b/lib/libesp32/berry_animation/anim_tutorials/chap_5_40_cylon_rainbow.anim @@ -0,0 +1,25 @@ +# @desc Moving rainbow beacon and stars +# In this example we combine a Twinkle star as background, +# a moving beacon with a dynamic color using the rainbow palette + +# Because strip_length is dynamic, we need to map it to a variable and can't use the function directly in formulas +set strip_len = strip_length() + +animation stars = twinkle_animation( + color=0xFFFFAA # Light yellow sparkles + density=2 # density (moderate sparkles) + twinkle_speed=100ms # twinkle speed + fade_speed=100 # when no unit, time unit is 'ms' + # priority = 10 # this is the implicit priority +) +run stars + +# We can combine a dynamic 'pos' value with a dynamic 'color' +animation back = beacon_animation( + color = rich_palette(palette=PALETTE_RAINBOW_W2, cycle_period=5s) + pos = cosine_osc(min_value = -1, max_value = strip_len - 2, duration = 5s) + beacon_size = 3 # small 3 pixels eye + slew_size = 2 # with 2 pixel shading around + priority = 5 # priority below 10 so it's on top of twinkle +) +run back \ No newline at end of file diff --git a/lib/libesp32/berry_animation/anim_tutorials/chap_5_50_cylon_as_opacity.anim b/lib/libesp32/berry_animation/anim_tutorials/chap_5_50_cylon_as_opacity.anim new file mode 100644 index 000000000..b9462f1a8 --- /dev/null +++ b/lib/libesp32/berry_animation/anim_tutorials/chap_5_50_cylon_as_opacity.anim @@ -0,0 +1,27 @@ +# @desc Moving beacon used as opacity filter on pattern +# In this example we use the moving beacon as an opacity mask +# on top of a pattern + +# Define 'strip_len' to make calculations +set strip_len = strip_length() + +# Define a pattern that goes from red to blue to red across the strip +palette red_blue_red_palette = [ red, 0x3333FF, red ] +# Embed this raw palette into a rich_palette color provider +color red_blue_red_color = rich_palette(palette=red_blue_red_palette) + +# Define a moving beacon to be used as an opacity mask +animation moving_eye = beacon_animation( + color = white # the color is not important, only the opacity counts here + pos = cosine_osc(min_value = -1, max_value = strip_len - 2, duration = 5s) + beacon_size = 3 # small 3 pixels eye + slew_size = 2 # with 2 pixel shading around +) + +# The palette gradient animation is used with an animation as opacity +animation eye_pattern = palette_gradient_animation( + color_source = red_blue_red_color # the beacon animation used as opacity + # spatial_period = strip_len # implicit + opacity = moving_eye +) +run eye_pattern \ No newline at end of file diff --git a/lib/libesp32/berry_animation/anim_tutorials/chap_6_10_shutter.anim b/lib/libesp32/berry_animation/anim_tutorials/chap_6_10_shutter.anim new file mode 100644 index 000000000..a1f0cef25 --- /dev/null +++ b/lib/libesp32/berry_animation/anim_tutorials/chap_6_10_shutter.anim @@ -0,0 +1,17 @@ +# @desc Shutter left to right using beacon + +# Define 'strip_len' to make calculations +set strip_len = strip_length() + +# Define shutter_size as a sawtootgh from 0 to strip_len +set shutter_size = sawtooth(min_value = 0, max_value = strip_len, + duration = 1.5s) + +# Using beacon_animation to move a shutter from left to right + animation shutter_lr_animation = beacon_animation( + color = red + back_color = blue + pos = 0 # Start from position 0 (left) + beacon_size = shutter_size # Oscillating size from 0 to strip_len +) +run shutter_lr_animation \ No newline at end of file diff --git a/lib/libesp32/berry_animation/anim_tutorials/chap_6_20_shutter_rotating_colors.anim b/lib/libesp32/berry_animation/anim_tutorials/chap_6_20_shutter_rotating_colors.anim new file mode 100644 index 000000000..cb79f842a --- /dev/null +++ b/lib/libesp32/berry_animation/anim_tutorials/chap_6_20_shutter_rotating_colors.anim @@ -0,0 +1,35 @@ +# @desc Shutter left to right with rotating colors, using sequence + +# Define 'strip_len' to make calculations +set strip_len = strip_length() + +# Set a global variable for 'period' +set period = 1.5s + +# Define shutter_size as a sawtootgh from 0 to strip_len +set shutter_size = sawtooth(min_value = 0, max_value = strip_len, + duration = period) + +# Define 2 color providers cycling through palette rainbow with white +# 'col2' is shifted by 1 color from 'col1' +color col1 = color_cycle(palette=PALETTE_RAINBOW_W, cycle_period=0) +color col2 = color_cycle(palette=PALETTE_RAINBOW_W, cycle_period=0) +col2.next = 1 # Writing 1 to 'next' actually advances the color + +# Using beacon_animation to move a shutter from left to right +animation shutter_lr_animation = beacon_animation( + color = col2 # Use two rotating colors + back_color = col1 # Use two rotating colors + pos = 0 # Start from position 0 (left) + beacon_size = shutter_size + # Oscillating size from 0 to strip_len +) + +# Define a sequence running forever +sequence shutter_seq repeat forever { + restart shutter_size # Make sure that shutter_size is synced with the sequence + play shutter_lr_animation for period # Play animation + col1.next = 1 # set 'col1' to next color + col2.next = 1 # set 'col2' to next color +} +run shutter_seq \ No newline at end of file diff --git a/lib/libesp32/berry_animation/anim_tutorials/png/chap_1_10.png b/lib/libesp32/berry_animation/anim_tutorials/png/chap_1_10.png new file mode 100644 index 000000000..eda18aa7e Binary files /dev/null and b/lib/libesp32/berry_animation/anim_tutorials/png/chap_1_10.png differ diff --git a/lib/libesp32/berry_animation/anim_tutorials/png/chap_1_20.png b/lib/libesp32/berry_animation/anim_tutorials/png/chap_1_20.png new file mode 100644 index 000000000..15c5fd165 Binary files /dev/null and b/lib/libesp32/berry_animation/anim_tutorials/png/chap_1_20.png differ diff --git a/lib/libesp32/berry_animation/anim_tutorials/png/chap_1_30.png b/lib/libesp32/berry_animation/anim_tutorials/png/chap_1_30.png new file mode 100644 index 000000000..b5f28b529 Binary files /dev/null and b/lib/libesp32/berry_animation/anim_tutorials/png/chap_1_30.png differ diff --git a/lib/libesp32/berry_animation/anim_tutorials/png/chap_1_40.png b/lib/libesp32/berry_animation/anim_tutorials/png/chap_1_40.png new file mode 100644 index 000000000..c78685474 Binary files /dev/null and b/lib/libesp32/berry_animation/anim_tutorials/png/chap_1_40.png differ diff --git a/lib/libesp32/berry_animation/anim_tutorials/png/chap_1_50.png b/lib/libesp32/berry_animation/anim_tutorials/png/chap_1_50.png new file mode 100644 index 000000000..3aa6f4270 Binary files /dev/null and b/lib/libesp32/berry_animation/anim_tutorials/png/chap_1_50.png differ diff --git a/lib/libesp32/berry_animation/anim_tutorials/png/chap_2_10.png b/lib/libesp32/berry_animation/anim_tutorials/png/chap_2_10.png new file mode 100644 index 000000000..1368e2a5f Binary files /dev/null and b/lib/libesp32/berry_animation/anim_tutorials/png/chap_2_10.png differ diff --git a/lib/libesp32/berry_animation/anim_tutorials/png/chap_2_20.png b/lib/libesp32/berry_animation/anim_tutorials/png/chap_2_20.png new file mode 100644 index 000000000..d5e84a1e4 Binary files /dev/null and b/lib/libesp32/berry_animation/anim_tutorials/png/chap_2_20.png differ diff --git a/lib/libesp32/berry_animation/anim_tutorials/png/chap_3_10.png b/lib/libesp32/berry_animation/anim_tutorials/png/chap_3_10.png new file mode 100644 index 000000000..65a36b4c3 Binary files /dev/null and b/lib/libesp32/berry_animation/anim_tutorials/png/chap_3_10.png differ diff --git a/lib/libesp32/berry_animation/anim_tutorials/png/chap_3_20.png b/lib/libesp32/berry_animation/anim_tutorials/png/chap_3_20.png new file mode 100644 index 000000000..d7e0bcbe1 Binary files /dev/null and b/lib/libesp32/berry_animation/anim_tutorials/png/chap_3_20.png differ diff --git a/lib/libesp32/berry_animation/anim_tutorials/png/chap_4_10.png b/lib/libesp32/berry_animation/anim_tutorials/png/chap_4_10.png new file mode 100644 index 000000000..fd1d95a62 Binary files /dev/null and b/lib/libesp32/berry_animation/anim_tutorials/png/chap_4_10.png differ diff --git a/lib/libesp32/berry_animation/anim_tutorials/png/chap_4_12.png b/lib/libesp32/berry_animation/anim_tutorials/png/chap_4_12.png new file mode 100644 index 000000000..435739cce Binary files /dev/null and b/lib/libesp32/berry_animation/anim_tutorials/png/chap_4_12.png differ diff --git a/lib/libesp32/berry_animation/anim_tutorials/png/chap_4_15.png b/lib/libesp32/berry_animation/anim_tutorials/png/chap_4_15.png new file mode 100644 index 000000000..4120e1809 Binary files /dev/null and b/lib/libesp32/berry_animation/anim_tutorials/png/chap_4_15.png differ diff --git a/lib/libesp32/berry_animation/anim_tutorials/png/chap_4_18.png b/lib/libesp32/berry_animation/anim_tutorials/png/chap_4_18.png new file mode 100644 index 000000000..27949d8e3 Binary files /dev/null and b/lib/libesp32/berry_animation/anim_tutorials/png/chap_4_18.png differ diff --git a/lib/libesp32/berry_animation/anim_tutorials/png/chap_4_30.png b/lib/libesp32/berry_animation/anim_tutorials/png/chap_4_30.png new file mode 100644 index 000000000..903a10e0e Binary files /dev/null and b/lib/libesp32/berry_animation/anim_tutorials/png/chap_4_30.png differ diff --git a/lib/libesp32/berry_animation/anim_tutorials/png/chap_4_35.png b/lib/libesp32/berry_animation/anim_tutorials/png/chap_4_35.png new file mode 100644 index 000000000..1bc9511e2 Binary files /dev/null and b/lib/libesp32/berry_animation/anim_tutorials/png/chap_4_35.png differ diff --git a/lib/libesp32/berry_animation/anim_tutorials/png/chap_5_10.png b/lib/libesp32/berry_animation/anim_tutorials/png/chap_5_10.png new file mode 100644 index 000000000..9f9cbc6a2 Binary files /dev/null and b/lib/libesp32/berry_animation/anim_tutorials/png/chap_5_10.png differ diff --git a/lib/libesp32/berry_animation/anim_tutorials/png/chap_5_15.png b/lib/libesp32/berry_animation/anim_tutorials/png/chap_5_15.png new file mode 100644 index 000000000..04067afd3 Binary files /dev/null and b/lib/libesp32/berry_animation/anim_tutorials/png/chap_5_15.png differ diff --git a/lib/libesp32/berry_animation/anim_tutorials/png/chap_5_20.png b/lib/libesp32/berry_animation/anim_tutorials/png/chap_5_20.png new file mode 100644 index 000000000..705c538ff Binary files /dev/null and b/lib/libesp32/berry_animation/anim_tutorials/png/chap_5_20.png differ diff --git a/lib/libesp32/berry_animation/anim_tutorials/png/chap_5_30.png b/lib/libesp32/berry_animation/anim_tutorials/png/chap_5_30.png new file mode 100644 index 000000000..d4f412c7d Binary files /dev/null and b/lib/libesp32/berry_animation/anim_tutorials/png/chap_5_30.png differ diff --git a/lib/libesp32/berry_animation/anim_tutorials/png/chap_5_40.png b/lib/libesp32/berry_animation/anim_tutorials/png/chap_5_40.png new file mode 100644 index 000000000..3543e92b5 Binary files /dev/null and b/lib/libesp32/berry_animation/anim_tutorials/png/chap_5_40.png differ diff --git a/lib/libesp32/berry_animation/anim_tutorials/png/chap_5_50.png b/lib/libesp32/berry_animation/anim_tutorials/png/chap_5_50.png new file mode 100644 index 000000000..9ef0bc5e9 Binary files /dev/null and b/lib/libesp32/berry_animation/anim_tutorials/png/chap_5_50.png differ diff --git a/lib/libesp32/berry_animation/anim_tutorials/png/chap_6_10.png b/lib/libesp32/berry_animation/anim_tutorials/png/chap_6_10.png new file mode 100644 index 000000000..99e33ecea Binary files /dev/null and b/lib/libesp32/berry_animation/anim_tutorials/png/chap_6_10.png differ diff --git a/lib/libesp32/berry_animation/anim_tutorials/png/chap_6_20.png b/lib/libesp32/berry_animation/anim_tutorials/png/chap_6_20.png new file mode 100644 index 000000000..24bea18ef Binary files /dev/null and b/lib/libesp32/berry_animation/anim_tutorials/png/chap_6_20.png differ