Thanks i'll take a look. Se if i can use it or abuse it.My hypothesis (untested) may be novel ( or not)- will be to trigger swing, with the ADXL using a state change mechanic. quantify all the axis readings upon start up, and trigger the swing based on the total state change.so- and the below code sample is me thinking out loud. it is not syntax accurate. setup for the pin outs and whatnot.int stateState = AnalogRead (X+Y+Z);void loopIf (New_State + State) is < or > (300 - New_State) // this number is totally arbitrary till i solder up the ADXL and start getting reads from rests and swings.Send_Command(1); //swingDelay (100); // if you can swing more than 10 times a second, have a cookie.New_State = State;
I think you are absolutely right keep it simple as possible.Tried to update my mathematical skills but quaternion's just gave me a headache...And hey a arduino is good but not a pentium i7 keeping the code as small as posible reduces the risk of lag.
Hey Star Wars Guys and Gals,I just got my sound modules (WT588D-16p 8m) for my sabres in last week though still need my arduino pro-mini usb program connector. I've made this sketch based on connecting the module to one of my mega's. It plays really well so far and is quite a bit different than the ones I've seen partially posted on this thread (sorry not yet at wanting to deal with accelerometers). There is the odd issue that will cause bouncing in the blade on/off function, however this attempt is the least buggy of my efforts thus far. It could use a new pair or multiple pairs of eyes to go over for optimizing and improvements if anyone is willing to take a crack. The end of the code hasn't been completed for the change in sound or colour states but that is wicked easy i just haven't decided which goes where I suppose. Code is nice! But what parts are you using? Old school tilt sensors and clash sensor? Cant blame you the 6050's code is dammned confusing and complex.Anyways a list of parts used makes it easier to understand or for someone to replicate. oooo so many codes recently! Thanks!!!
Nonsense !1. You don't have to understand mathematics behind quaternions tu use them. Just like you don't need to know how to read hexadecimal to code or know how an engine works to drive (would be best tho...) You just need to know what they do (they determine your hilt orientation) and find a library that can calculate quaternions from your gyroscope data. Of course you can still use only the gyroscope data, but you'll have to address "cadrant lockup" problems (and good luck with that)As for using G force to finely detect swings... I still don't see how you're going to manage to do that. But hey! If you find a better way to do this with your idea: be my guest !2.Do you find this laggy ?[EDIT]Sorry I didn't get the ADXL335 was only an accelerometer and not an IMU. So my solution is not applicable to your devicesBut hey still good luck with that !
any new sabers to show off? Wailer? Katan? Nesk?...Bueller?
I'm quite far from "show and tell" : I'm still working on the software.Anyway I don't want to rush any build stages. So when software will reach an acceptable state I'll switch to designing a good chassis. Then I'll make custom external part using a lathe.So not for tomorow