Protonerd / FX-SaberOS

System code for Arduino based Lightsaber replicas for DIYino family boards
Creative Commons Zero v1.0 Universal
92 stars 42 forks source link

Lockup effect #46

Closed FatherCool closed 4 years ago

FatherCool commented 6 years ago

Just a minor one here. When selecting the pulsating flicker style I notice that I no longer get the flashy lockup effect just the sound. Works great on the flickery flicker styles. Where in the code does it initiate the effect so that I can get it on for the pulsating style also?

Cheers.

Protonerd commented 6 years ago

I recall I programmed it a different way: in the pulse flicker style the pulsing gets faster in lockup. If even that does not work, I need to have a look what went wrong.

FatherCool commented 6 years ago

Ah right, well it looks no different to me. I much prefer the flashy interference effect that the flicker ones have.

Protonerd commented 6 years ago

Then use that flicker style :)

FatherCool commented 6 years ago

Haha indeed as I have.

I just liked the pulsing blade for the ancient weapon font!! It's no bother. I thought that I would just be able to copy and paste the flashy lock up effect into the part for the pulsing that's all! I just couldn't find where the code was for the flashy bit!

jbkuma commented 6 years ago

lockup code was my first contribution, I think, or perhaps the pixel ramp code.. anyway, it looks like Andras has updated it a bit to represent the blade colors better.

int lockupFlick = random(0,39); if (lockupFlick < 25) { analogWrite(LED_RED, (brightness maincolor.r / rgbFactor)); // RED analogWrite(LED_GREEN, (brightness maincolor.g / rgbFactor)); // GREEN analogWrite(LED_BLUE, (brightness maincolor.b / rgbFactor)); // BLUE } else if (lockupFlick < 35) { analogWrite(LED_RED, (brightness clashcolor.r / rgbFactor)); // RED analogWrite(LED_GREEN, (brightness clashcolor.g / rgbFactor)); // GREEN analogWrite(LED_BLUE, (brightness clashcolor.b / rgbFactor)); // BLUE } else { // simple white analogWrite(LED_RED, MAX_BRIGHTNESS); // RED analogWrite(LED_GREEN, MAX_BRIGHTNESS); // GREEN analogWrite(LED_BLUE, MAX_BRIGHTNESS); // BLUE } An interesting note here: When I originally came up with this I didn't reallize random(0,39) is actually an random value between 0 and 38! I found this out when I was having a hard time getting a random function to work properly. The first value is the starting value, and the ending value is a limit, not the last value. https://www.arduino.cc/reference/en/language/functions/random-numbers/random/

Jason "Kuma" Brinkerhoff Mad Science Workshoppe, proprietor http://jbkuma.com/workshoppe

On Mon, Jan 22, 2018 at 5:32 PM, FatherCool notifications@github.com wrote:

Haha indeed as I have.

I just liked the pulsing blade for the ancient weapon font!! It's no bother. I thought that I would just be able to copy and paste the flashy lock up effect into the part for the pulsing that's all! I just couldn't find where the code was for the flashy bit!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Protonerd/FX-SaberOS/issues/46#issuecomment-359593324, or mute the thread https://github.com/notifications/unsubscribe-auth/ATdCMLzi5UM7sKz-z46j5aAkZemWi_z5ks5tNQxwgaJpZM4Rex62 .