Go Down

Topic: Arduino Lightsaber (Read 310849 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.

Go Up