been working on this part, something about using the delay function to wait for the first sound to finish, is doing this. Need to replace this with a non-blocking delay... if anybody can come up with this solution please do share.
Of course thanks for that, without this thread i would not have come this far.But sifting through all snippets of sample code is pretty hard work and contributing to a more or less completed code would be more efficient, and more of a "open source" idea.But that is my humble opinion.
Anyone here use photoshop?For some reason the circuit artwork isn't printing at 1:1 scale and I don't know why.
do you use a laser or inkjet printer? master your files as PDF (if you can) print the PDF file in Reader and change your scaling to 1:1 or "original" or "100%" depending on your printer make and model.Don't print from a browser, double click the local PDF and print from Adobe Reader 10 is best 11 has some bugs. I can post screen grabs of 1:1 scale printing in Epson and HP printer dialog. If you are Canon or Lexmark, you are on your own.make sure you have "border-less" or "edge to edge" turned OFF. that should print to the scale you have in your original project.
Thanks Bill I use a Samsung laser printer and I've just set up laptop for the lab so may well have missed something. I'll have a look at the settings when I get back from work.The PDFs need a bit of contrast adjustment as they come out off white which shows in the prints and use photoshop 5.One thing is, I have to select pixle density on import and I'm wondering if that may be influencing things.
Special thanks to BillPealer for the tip about decaying your swing and clash sounds to the END of the hum sound. I've been mixing/remixing sound files for a while now, but the transitions from clash to hum were always (no pun intended) hit or miss. Since I employed this technique, the transitions are much smoother.
one could re-post a collective file that is a repository of all the (useful) sample code people have contributed. that would be nice. and a way to pay it forward.2-3 weeks i'll have ADXL335 code to post. though analogRead code is hardly scarce.
Been experimenting with the 335 to get usable readings.I think the best way is to convert the readings to G force's to detect a swing so you can easily up or down the sensitivity.You could even incorporate a potmeter (also connected to analog in) to adjust this while using your saber, even have different swing sounds per reading (swing 1 +g swing 2 -g)Have not been able to detect clashes with it but i think a standard clash detector (with a spring inside) should work better.Some interesting code can be found here https://chionophilous.wordpress.com/2011/06/20/getting-started-with-accelerometers-and-micro-controllers-arduino-adxl335/Hope i can post some code soon.
On MPU6050 device :I did use quaternion instead to detect a swing: any w axe variation means the hilt did move.As for swing sound : A simple random chose of swing sound do the same.I did use G force variations to detect clashes. But I agree with that a clash/bump sensor would better suit that role.I did post my full code, hoping people may complete it with other devices :LightSaberOS
Note that he used an MPU6050 which is a different animal than the ADXL335 chosen as the standard motion sensor in this thread. So keep that in mind when trying to apply techniques found in this code.
I did post my full code, hoping people may complete it with other devices :LightSaberOS