Go Down

Topic: Arduino Lightsaber (Read 329784 times) previous topic - next topic

jbkuma

in ./Config_SW.h
#define SWING_SUPPRESS     500
#define CLASH_SUPRESS     400  // do not modify below 400, otherwise interlocking clash sounds can occur
#define BLASTERBLOCK_SUPRESS     500

You can play with these options to get the effect you want, and ignoring the note here won't break anything.

If your clash isn't activating though, maybe it is related to the way your board is mounted.  If it isn't firmly secured it could dampen the impact.

Protonerd

Thanks for a fast reply. Just reread my post and realized that maybe didn't explain it prorerly.

So what happens is they hit sabers and saber changes color. They hit again pretty fast and because saber is still in a state of changed color(flash on clash) it looks wierd, like if they didn't do a second hit even though they did. Also, since the clash itself is few miliseconds longer sabers are still touching each other and change color back to normal not when they part them but when they are still in a clash state.

So in the end it looks like when they clashed sabers second time they did it in a "flash on clash" already on and then it changes color to normal too early so you get a feeling something is either too slow or too fast.

They did couple fights and every time maybe 1 out of 3-4 hits if they keep up a fast dueling pace appears to be w/o any flash or more like flash staying on. So i started to wonder if it may be related to me using poll method or i just need to make the flash time shorter(if it's even possible).

Sorry if they way i described it is too confusing...
I fully agree to what jbkuma wrote, we human beings cannot execute movements faster than the processing speed of even a mere 8-bit controller, so defintely the assumption that the circuit is occupied with something else when the next clash occurs is wrong. But there are parameters described in jbkuma's answer which govern the minimum time between clashes and the FX duration. That said, both with the poll and int based clash detection, for our human perception of time the response is instantenous.

techjunkie

So has anyone firgured out how use the LSOS or FX-saberOS on a ADAfruit feather ATmega328 or a Feather mo express with Music maker feather wing which has both the sd reader and the?  Novice would be an improvement on my coding skills. i am trying t learn so i can adapt LSOS currently by setting pins and using the luxeon codes for my pcb led.
it seems like it would be straight forward if i was using the same accelorometer and Dfplayer but i am building two sabers with the adafruit i already have. so a point in the right direction would be amazing if anyone can help

jbkuma

You can use any ATmega328 based board so long as the necessary pins are available.

Several of us are working on an M0 base solution, but none of us has had a lot of time to devote to it yet.  The platform is entirely different and LSOS/FX-SaberOS cannot be directly ported to it in the way you suggested.

JakeSoft

I have been quietly working on this for quite some time now. It's almost done.

S.T.R.E.A.M. v1.0 Preview Video

Go Up